aws_sdk_iot/operation/register_certificate/
_register_certificate_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The input to the RegisterCertificate operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct RegisterCertificateInput {
7    /// <p>The certificate data, in PEM format.</p>
8    pub certificate_pem: ::std::option::Option<::std::string::String>,
9    /// <p>The CA certificate used to sign the device certificate being registered.</p>
10    pub ca_certificate_pem: ::std::option::Option<::std::string::String>,
11    /// <p>A boolean value that specifies if the certificate is set to active.</p>
12    /// <p>Valid values: <code>ACTIVE | INACTIVE</code></p>
13    #[deprecated]
14    pub set_as_active: ::std::option::Option<bool>,
15    /// <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>
16    pub status: ::std::option::Option<crate::types::CertificateStatus>,
17}
18impl RegisterCertificateInput {
19    /// <p>The certificate data, in PEM format.</p>
20    pub fn certificate_pem(&self) -> ::std::option::Option<&str> {
21        self.certificate_pem.as_deref()
22    }
23    /// <p>The CA certificate used to sign the device certificate being registered.</p>
24    pub fn ca_certificate_pem(&self) -> ::std::option::Option<&str> {
25        self.ca_certificate_pem.as_deref()
26    }
27    /// <p>A boolean value that specifies if the certificate is set to active.</p>
28    /// <p>Valid values: <code>ACTIVE | INACTIVE</code></p>
29    #[deprecated]
30    pub fn set_as_active(&self) -> ::std::option::Option<bool> {
31        self.set_as_active
32    }
33    /// <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>
34    pub fn status(&self) -> ::std::option::Option<&crate::types::CertificateStatus> {
35        self.status.as_ref()
36    }
37}
38impl RegisterCertificateInput {
39    /// Creates a new builder-style object to manufacture [`RegisterCertificateInput`](crate::operation::register_certificate::RegisterCertificateInput).
40    pub fn builder() -> crate::operation::register_certificate::builders::RegisterCertificateInputBuilder {
41        crate::operation::register_certificate::builders::RegisterCertificateInputBuilder::default()
42    }
43}
44
45/// A builder for [`RegisterCertificateInput`](crate::operation::register_certificate::RegisterCertificateInput).
46#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
47#[non_exhaustive]
48pub struct RegisterCertificateInputBuilder {
49    pub(crate) certificate_pem: ::std::option::Option<::std::string::String>,
50    pub(crate) ca_certificate_pem: ::std::option::Option<::std::string::String>,
51    pub(crate) set_as_active: ::std::option::Option<bool>,
52    pub(crate) status: ::std::option::Option<crate::types::CertificateStatus>,
53}
54impl RegisterCertificateInputBuilder {
55    /// <p>The certificate data, in PEM format.</p>
56    /// This field is required.
57    pub fn certificate_pem(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
58        self.certificate_pem = ::std::option::Option::Some(input.into());
59        self
60    }
61    /// <p>The certificate data, in PEM format.</p>
62    pub fn set_certificate_pem(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
63        self.certificate_pem = input;
64        self
65    }
66    /// <p>The certificate data, in PEM format.</p>
67    pub fn get_certificate_pem(&self) -> &::std::option::Option<::std::string::String> {
68        &self.certificate_pem
69    }
70    /// <p>The CA certificate used to sign the device certificate being registered.</p>
71    pub fn ca_certificate_pem(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
72        self.ca_certificate_pem = ::std::option::Option::Some(input.into());
73        self
74    }
75    /// <p>The CA certificate used to sign the device certificate being registered.</p>
76    pub fn set_ca_certificate_pem(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
77        self.ca_certificate_pem = input;
78        self
79    }
80    /// <p>The CA certificate used to sign the device certificate being registered.</p>
81    pub fn get_ca_certificate_pem(&self) -> &::std::option::Option<::std::string::String> {
82        &self.ca_certificate_pem
83    }
84    /// <p>A boolean value that specifies if the certificate is set to active.</p>
85    /// <p>Valid values: <code>ACTIVE | INACTIVE</code></p>
86    #[deprecated]
87    pub fn set_as_active(mut self, input: bool) -> Self {
88        self.set_as_active = ::std::option::Option::Some(input);
89        self
90    }
91    /// <p>A boolean value that specifies if the certificate is set to active.</p>
92    /// <p>Valid values: <code>ACTIVE | INACTIVE</code></p>
93    #[deprecated]
94    pub fn set_set_as_active(mut self, input: ::std::option::Option<bool>) -> Self {
95        self.set_as_active = input;
96        self
97    }
98    /// <p>A boolean value that specifies if the certificate is set to active.</p>
99    /// <p>Valid values: <code>ACTIVE | INACTIVE</code></p>
100    #[deprecated]
101    pub fn get_set_as_active(&self) -> &::std::option::Option<bool> {
102        &self.set_as_active
103    }
104    /// <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>
105    pub fn status(mut self, input: crate::types::CertificateStatus) -> Self {
106        self.status = ::std::option::Option::Some(input);
107        self
108    }
109    /// <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>
110    pub fn set_status(mut self, input: ::std::option::Option<crate::types::CertificateStatus>) -> Self {
111        self.status = input;
112        self
113    }
114    /// <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>
115    pub fn get_status(&self) -> &::std::option::Option<crate::types::CertificateStatus> {
116        &self.status
117    }
118    /// Consumes the builder and constructs a [`RegisterCertificateInput`](crate::operation::register_certificate::RegisterCertificateInput).
119    pub fn build(
120        self,
121    ) -> ::std::result::Result<crate::operation::register_certificate::RegisterCertificateInput, ::aws_smithy_types::error::operation::BuildError>
122    {
123        ::std::result::Result::Ok(crate::operation::register_certificate::RegisterCertificateInput {
124            certificate_pem: self.certificate_pem,
125            ca_certificate_pem: self.ca_certificate_pem,
126            set_as_active: self.set_as_active,
127            status: self.status,
128        })
129    }
130}