aws-sdk-acmpca 1.90.0

AWS SDK for AWS Certificate Manager Private Certificate Authority
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Validity specifies the period of time during which a certificate is valid. Validity can be expressed as an explicit date and time when the validity of a certificate starts or expires, or as a span of time after issuance, stated in days, months, or years. For more information, see <a href="https://tools.ietf.org/html/rfc5280#section-4.1.2.5">Validity</a> in RFC 5280.</p>
/// <p>Amazon Web Services Private CA API consumes the <code>Validity</code> data type differently in two distinct parameters of the <code>IssueCertificate</code> action. The required parameter <code>IssueCertificate</code>:<code>Validity</code> specifies the end of a certificate's validity period. The optional parameter <code>IssueCertificate</code>:<code>ValidityNotBefore</code> specifies a customized starting time for the validity period.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Validity {
    /// <p>A long integer interpreted according to the value of <code>Type</code>, below.</p>
    pub value: i64,
    /// <p>Determines how <i>Amazon Web Services Private CA</i> interprets the <code>Value</code> parameter, an integer. Supported validity types include those listed below. Type definitions with values include a sample input value and the resulting output.</p>
    /// <p><code>END_DATE</code>: The specific date and time when the certificate will expire, expressed using UTCTime (YYMMDDHHMMSS) or GeneralizedTime (YYYYMMDDHHMMSS) format. When UTCTime is used, if the year field (YY) is greater than or equal to 50, the year is interpreted as 19YY. If the year field is less than 50, the year is interpreted as 20YY.</p>
    /// <ul>
    /// <li>
    /// <p>Sample input value: 491231235959 (UTCTime format)</p></li>
    /// <li>
    /// <p>Output expiration date/time: 12/31/2049 23:59:59</p></li>
    /// </ul>
    /// <p><code>ABSOLUTE</code>: The specific date and time when the validity of a certificate will start or expire, expressed in seconds since the Unix Epoch.</p>
    /// <ul>
    /// <li>
    /// <p>Sample input value: 2524608000</p></li>
    /// <li>
    /// <p>Output expiration date/time: 01/01/2050 00:00:00</p></li>
    /// </ul>
    /// <p><code>DAYS</code>, <code>MONTHS</code>, <code>YEARS</code>: The relative time from the moment of issuance until the certificate will expire, expressed in days, months, or years.</p>
    /// <p>Example if <code>DAYS</code>, issued on 10/12/2020 at 12:34:54 UTC:</p>
    /// <ul>
    /// <li>
    /// <p>Sample input value: 90</p></li>
    /// <li>
    /// <p>Output expiration date: 01/10/2020 12:34:54 UTC</p></li>
    /// </ul>
    /// <p>The minimum validity duration for a certificate using relative time (<code>DAYS</code>) is one day. The minimum validity for a certificate using absolute time (<code>ABSOLUTE</code> or <code>END_DATE</code>) is one second.</p>
    pub r#type: crate::types::ValidityPeriodType,
}
impl Validity {
    /// <p>A long integer interpreted according to the value of <code>Type</code>, below.</p>
    pub fn value(&self) -> i64 {
        self.value
    }
    /// <p>Determines how <i>Amazon Web Services Private CA</i> interprets the <code>Value</code> parameter, an integer. Supported validity types include those listed below. Type definitions with values include a sample input value and the resulting output.</p>
    /// <p><code>END_DATE</code>: The specific date and time when the certificate will expire, expressed using UTCTime (YYMMDDHHMMSS) or GeneralizedTime (YYYYMMDDHHMMSS) format. When UTCTime is used, if the year field (YY) is greater than or equal to 50, the year is interpreted as 19YY. If the year field is less than 50, the year is interpreted as 20YY.</p>
    /// <ul>
    /// <li>
    /// <p>Sample input value: 491231235959 (UTCTime format)</p></li>
    /// <li>
    /// <p>Output expiration date/time: 12/31/2049 23:59:59</p></li>
    /// </ul>
    /// <p><code>ABSOLUTE</code>: The specific date and time when the validity of a certificate will start or expire, expressed in seconds since the Unix Epoch.</p>
    /// <ul>
    /// <li>
    /// <p>Sample input value: 2524608000</p></li>
    /// <li>
    /// <p>Output expiration date/time: 01/01/2050 00:00:00</p></li>
    /// </ul>
    /// <p><code>DAYS</code>, <code>MONTHS</code>, <code>YEARS</code>: The relative time from the moment of issuance until the certificate will expire, expressed in days, months, or years.</p>
    /// <p>Example if <code>DAYS</code>, issued on 10/12/2020 at 12:34:54 UTC:</p>
    /// <ul>
    /// <li>
    /// <p>Sample input value: 90</p></li>
    /// <li>
    /// <p>Output expiration date: 01/10/2020 12:34:54 UTC</p></li>
    /// </ul>
    /// <p>The minimum validity duration for a certificate using relative time (<code>DAYS</code>) is one day. The minimum validity for a certificate using absolute time (<code>ABSOLUTE</code> or <code>END_DATE</code>) is one second.</p>
    pub fn r#type(&self) -> &crate::types::ValidityPeriodType {
        &self.r#type
    }
}
impl Validity {
    /// Creates a new builder-style object to manufacture [`Validity`](crate::types::Validity).
    pub fn builder() -> crate::types::builders::ValidityBuilder {
        crate::types::builders::ValidityBuilder::default()
    }
}

/// A builder for [`Validity`](crate::types::Validity).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ValidityBuilder {
    pub(crate) value: ::std::option::Option<i64>,
    pub(crate) r#type: ::std::option::Option<crate::types::ValidityPeriodType>,
}
impl ValidityBuilder {
    /// <p>A long integer interpreted according to the value of <code>Type</code>, below.</p>
    /// This field is required.
    pub fn value(mut self, input: i64) -> Self {
        self.value = ::std::option::Option::Some(input);
        self
    }
    /// <p>A long integer interpreted according to the value of <code>Type</code>, below.</p>
    pub fn set_value(mut self, input: ::std::option::Option<i64>) -> Self {
        self.value = input;
        self
    }
    /// <p>A long integer interpreted according to the value of <code>Type</code>, below.</p>
    pub fn get_value(&self) -> &::std::option::Option<i64> {
        &self.value
    }
    /// <p>Determines how <i>Amazon Web Services Private CA</i> interprets the <code>Value</code> parameter, an integer. Supported validity types include those listed below. Type definitions with values include a sample input value and the resulting output.</p>
    /// <p><code>END_DATE</code>: The specific date and time when the certificate will expire, expressed using UTCTime (YYMMDDHHMMSS) or GeneralizedTime (YYYYMMDDHHMMSS) format. When UTCTime is used, if the year field (YY) is greater than or equal to 50, the year is interpreted as 19YY. If the year field is less than 50, the year is interpreted as 20YY.</p>
    /// <ul>
    /// <li>
    /// <p>Sample input value: 491231235959 (UTCTime format)</p></li>
    /// <li>
    /// <p>Output expiration date/time: 12/31/2049 23:59:59</p></li>
    /// </ul>
    /// <p><code>ABSOLUTE</code>: The specific date and time when the validity of a certificate will start or expire, expressed in seconds since the Unix Epoch.</p>
    /// <ul>
    /// <li>
    /// <p>Sample input value: 2524608000</p></li>
    /// <li>
    /// <p>Output expiration date/time: 01/01/2050 00:00:00</p></li>
    /// </ul>
    /// <p><code>DAYS</code>, <code>MONTHS</code>, <code>YEARS</code>: The relative time from the moment of issuance until the certificate will expire, expressed in days, months, or years.</p>
    /// <p>Example if <code>DAYS</code>, issued on 10/12/2020 at 12:34:54 UTC:</p>
    /// <ul>
    /// <li>
    /// <p>Sample input value: 90</p></li>
    /// <li>
    /// <p>Output expiration date: 01/10/2020 12:34:54 UTC</p></li>
    /// </ul>
    /// <p>The minimum validity duration for a certificate using relative time (<code>DAYS</code>) is one day. The minimum validity for a certificate using absolute time (<code>ABSOLUTE</code> or <code>END_DATE</code>) is one second.</p>
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::ValidityPeriodType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>Determines how <i>Amazon Web Services Private CA</i> interprets the <code>Value</code> parameter, an integer. Supported validity types include those listed below. Type definitions with values include a sample input value and the resulting output.</p>
    /// <p><code>END_DATE</code>: The specific date and time when the certificate will expire, expressed using UTCTime (YYMMDDHHMMSS) or GeneralizedTime (YYYYMMDDHHMMSS) format. When UTCTime is used, if the year field (YY) is greater than or equal to 50, the year is interpreted as 19YY. If the year field is less than 50, the year is interpreted as 20YY.</p>
    /// <ul>
    /// <li>
    /// <p>Sample input value: 491231235959 (UTCTime format)</p></li>
    /// <li>
    /// <p>Output expiration date/time: 12/31/2049 23:59:59</p></li>
    /// </ul>
    /// <p><code>ABSOLUTE</code>: The specific date and time when the validity of a certificate will start or expire, expressed in seconds since the Unix Epoch.</p>
    /// <ul>
    /// <li>
    /// <p>Sample input value: 2524608000</p></li>
    /// <li>
    /// <p>Output expiration date/time: 01/01/2050 00:00:00</p></li>
    /// </ul>
    /// <p><code>DAYS</code>, <code>MONTHS</code>, <code>YEARS</code>: The relative time from the moment of issuance until the certificate will expire, expressed in days, months, or years.</p>
    /// <p>Example if <code>DAYS</code>, issued on 10/12/2020 at 12:34:54 UTC:</p>
    /// <ul>
    /// <li>
    /// <p>Sample input value: 90</p></li>
    /// <li>
    /// <p>Output expiration date: 01/10/2020 12:34:54 UTC</p></li>
    /// </ul>
    /// <p>The minimum validity duration for a certificate using relative time (<code>DAYS</code>) is one day. The minimum validity for a certificate using absolute time (<code>ABSOLUTE</code> or <code>END_DATE</code>) is one second.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ValidityPeriodType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>Determines how <i>Amazon Web Services Private CA</i> interprets the <code>Value</code> parameter, an integer. Supported validity types include those listed below. Type definitions with values include a sample input value and the resulting output.</p>
    /// <p><code>END_DATE</code>: The specific date and time when the certificate will expire, expressed using UTCTime (YYMMDDHHMMSS) or GeneralizedTime (YYYYMMDDHHMMSS) format. When UTCTime is used, if the year field (YY) is greater than or equal to 50, the year is interpreted as 19YY. If the year field is less than 50, the year is interpreted as 20YY.</p>
    /// <ul>
    /// <li>
    /// <p>Sample input value: 491231235959 (UTCTime format)</p></li>
    /// <li>
    /// <p>Output expiration date/time: 12/31/2049 23:59:59</p></li>
    /// </ul>
    /// <p><code>ABSOLUTE</code>: The specific date and time when the validity of a certificate will start or expire, expressed in seconds since the Unix Epoch.</p>
    /// <ul>
    /// <li>
    /// <p>Sample input value: 2524608000</p></li>
    /// <li>
    /// <p>Output expiration date/time: 01/01/2050 00:00:00</p></li>
    /// </ul>
    /// <p><code>DAYS</code>, <code>MONTHS</code>, <code>YEARS</code>: The relative time from the moment of issuance until the certificate will expire, expressed in days, months, or years.</p>
    /// <p>Example if <code>DAYS</code>, issued on 10/12/2020 at 12:34:54 UTC:</p>
    /// <ul>
    /// <li>
    /// <p>Sample input value: 90</p></li>
    /// <li>
    /// <p>Output expiration date: 01/10/2020 12:34:54 UTC</p></li>
    /// </ul>
    /// <p>The minimum validity duration for a certificate using relative time (<code>DAYS</code>) is one day. The minimum validity for a certificate using absolute time (<code>ABSOLUTE</code> or <code>END_DATE</code>) is one second.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::ValidityPeriodType> {
        &self.r#type
    }
    /// Consumes the builder and constructs a [`Validity`](crate::types::Validity).
    /// This method will fail if any of the following fields are not set:
    /// - [`value`](crate::types::builders::ValidityBuilder::value)
    /// - [`r#type`](crate::types::builders::ValidityBuilder::type)
    pub fn build(self) -> ::std::result::Result<crate::types::Validity, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Validity {
            value: self.value.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "value",
                    "value was not specified but it is required when building Validity",
                )
            })?,
            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 Validity",
                )
            })?,
        })
    }
}