aws_sdk_acm/operation/revoke_certificate/
_revoke_certificate_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct RevokeCertificateInput {
6    /// <p>The Amazon Resource Name (ARN) of the public or private certificate that will be revoked. The ARN must have the following form:</p>
7    /// <p><code>arn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012</code></p>
8    pub certificate_arn: ::std::option::Option<::std::string::String>,
9    /// <p>Specifies why you revoked the certificate.</p>
10    pub revocation_reason: ::std::option::Option<crate::types::RevocationReason>,
11}
12impl RevokeCertificateInput {
13    /// <p>The Amazon Resource Name (ARN) of the public or private certificate that will be revoked. The ARN must have the following form:</p>
14    /// <p><code>arn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012</code></p>
15    pub fn certificate_arn(&self) -> ::std::option::Option<&str> {
16        self.certificate_arn.as_deref()
17    }
18    /// <p>Specifies why you revoked the certificate.</p>
19    pub fn revocation_reason(&self) -> ::std::option::Option<&crate::types::RevocationReason> {
20        self.revocation_reason.as_ref()
21    }
22}
23impl RevokeCertificateInput {
24    /// Creates a new builder-style object to manufacture [`RevokeCertificateInput`](crate::operation::revoke_certificate::RevokeCertificateInput).
25    pub fn builder() -> crate::operation::revoke_certificate::builders::RevokeCertificateInputBuilder {
26        crate::operation::revoke_certificate::builders::RevokeCertificateInputBuilder::default()
27    }
28}
29
30/// A builder for [`RevokeCertificateInput`](crate::operation::revoke_certificate::RevokeCertificateInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct RevokeCertificateInputBuilder {
34    pub(crate) certificate_arn: ::std::option::Option<::std::string::String>,
35    pub(crate) revocation_reason: ::std::option::Option<crate::types::RevocationReason>,
36}
37impl RevokeCertificateInputBuilder {
38    /// <p>The Amazon Resource Name (ARN) of the public or private certificate that will be revoked. The ARN must have the following form:</p>
39    /// <p><code>arn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012</code></p>
40    /// This field is required.
41    pub fn certificate_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
42        self.certificate_arn = ::std::option::Option::Some(input.into());
43        self
44    }
45    /// <p>The Amazon Resource Name (ARN) of the public or private certificate that will be revoked. The ARN must have the following form:</p>
46    /// <p><code>arn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012</code></p>
47    pub fn set_certificate_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
48        self.certificate_arn = input;
49        self
50    }
51    /// <p>The Amazon Resource Name (ARN) of the public or private certificate that will be revoked. The ARN must have the following form:</p>
52    /// <p><code>arn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012</code></p>
53    pub fn get_certificate_arn(&self) -> &::std::option::Option<::std::string::String> {
54        &self.certificate_arn
55    }
56    /// <p>Specifies why you revoked the certificate.</p>
57    /// This field is required.
58    pub fn revocation_reason(mut self, input: crate::types::RevocationReason) -> Self {
59        self.revocation_reason = ::std::option::Option::Some(input);
60        self
61    }
62    /// <p>Specifies why you revoked the certificate.</p>
63    pub fn set_revocation_reason(mut self, input: ::std::option::Option<crate::types::RevocationReason>) -> Self {
64        self.revocation_reason = input;
65        self
66    }
67    /// <p>Specifies why you revoked the certificate.</p>
68    pub fn get_revocation_reason(&self) -> &::std::option::Option<crate::types::RevocationReason> {
69        &self.revocation_reason
70    }
71    /// Consumes the builder and constructs a [`RevokeCertificateInput`](crate::operation::revoke_certificate::RevokeCertificateInput).
72    pub fn build(
73        self,
74    ) -> ::std::result::Result<crate::operation::revoke_certificate::RevokeCertificateInput, ::aws_smithy_types::error::operation::BuildError> {
75        ::std::result::Result::Ok(crate::operation::revoke_certificate::RevokeCertificateInput {
76            certificate_arn: self.certificate_arn,
77            revocation_reason: self.revocation_reason,
78        })
79    }
80}