1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// 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).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
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,
        })
    }
}