aws_sdk_iot/operation/update_certificate/
_update_certificate_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The input for the UpdateCertificate operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateCertificateInput {
7    /// <p>The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</p>
8    pub certificate_id: ::std::option::Option<::std::string::String>,
9    /// <p>The new status.</p>
10    /// <p><b>Note:</b> Setting the status to PENDING_TRANSFER or PENDING_ACTIVATION will result in an exception being thrown. PENDING_TRANSFER and PENDING_ACTIVATION are statuses used internally by IoT. They are not intended for developer use.</p>
11    /// <p><b>Note:</b> The status value REGISTER_INACTIVE is deprecated and should not be used.</p>
12    pub new_status: ::std::option::Option<crate::types::CertificateStatus>,
13}
14impl UpdateCertificateInput {
15    /// <p>The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</p>
16    pub fn certificate_id(&self) -> ::std::option::Option<&str> {
17        self.certificate_id.as_deref()
18    }
19    /// <p>The new status.</p>
20    /// <p><b>Note:</b> Setting the status to PENDING_TRANSFER or PENDING_ACTIVATION will result in an exception being thrown. PENDING_TRANSFER and PENDING_ACTIVATION are statuses used internally by IoT. They are not intended for developer use.</p>
21    /// <p><b>Note:</b> The status value REGISTER_INACTIVE is deprecated and should not be used.</p>
22    pub fn new_status(&self) -> ::std::option::Option<&crate::types::CertificateStatus> {
23        self.new_status.as_ref()
24    }
25}
26impl UpdateCertificateInput {
27    /// Creates a new builder-style object to manufacture [`UpdateCertificateInput`](crate::operation::update_certificate::UpdateCertificateInput).
28    pub fn builder() -> crate::operation::update_certificate::builders::UpdateCertificateInputBuilder {
29        crate::operation::update_certificate::builders::UpdateCertificateInputBuilder::default()
30    }
31}
32
33/// A builder for [`UpdateCertificateInput`](crate::operation::update_certificate::UpdateCertificateInput).
34#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
35#[non_exhaustive]
36pub struct UpdateCertificateInputBuilder {
37    pub(crate) certificate_id: ::std::option::Option<::std::string::String>,
38    pub(crate) new_status: ::std::option::Option<crate::types::CertificateStatus>,
39}
40impl UpdateCertificateInputBuilder {
41    /// <p>The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</p>
42    /// This field is required.
43    pub fn certificate_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
44        self.certificate_id = ::std::option::Option::Some(input.into());
45        self
46    }
47    /// <p>The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</p>
48    pub fn set_certificate_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
49        self.certificate_id = input;
50        self
51    }
52    /// <p>The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</p>
53    pub fn get_certificate_id(&self) -> &::std::option::Option<::std::string::String> {
54        &self.certificate_id
55    }
56    /// <p>The new status.</p>
57    /// <p><b>Note:</b> Setting the status to PENDING_TRANSFER or PENDING_ACTIVATION will result in an exception being thrown. PENDING_TRANSFER and PENDING_ACTIVATION are statuses used internally by IoT. They are not intended for developer use.</p>
58    /// <p><b>Note:</b> The status value REGISTER_INACTIVE is deprecated and should not be used.</p>
59    /// This field is required.
60    pub fn new_status(mut self, input: crate::types::CertificateStatus) -> Self {
61        self.new_status = ::std::option::Option::Some(input);
62        self
63    }
64    /// <p>The new status.</p>
65    /// <p><b>Note:</b> Setting the status to PENDING_TRANSFER or PENDING_ACTIVATION will result in an exception being thrown. PENDING_TRANSFER and PENDING_ACTIVATION are statuses used internally by IoT. They are not intended for developer use.</p>
66    /// <p><b>Note:</b> The status value REGISTER_INACTIVE is deprecated and should not be used.</p>
67    pub fn set_new_status(mut self, input: ::std::option::Option<crate::types::CertificateStatus>) -> Self {
68        self.new_status = input;
69        self
70    }
71    /// <p>The new status.</p>
72    /// <p><b>Note:</b> Setting the status to PENDING_TRANSFER or PENDING_ACTIVATION will result in an exception being thrown. PENDING_TRANSFER and PENDING_ACTIVATION are statuses used internally by IoT. They are not intended for developer use.</p>
73    /// <p><b>Note:</b> The status value REGISTER_INACTIVE is deprecated and should not be used.</p>
74    pub fn get_new_status(&self) -> &::std::option::Option<crate::types::CertificateStatus> {
75        &self.new_status
76    }
77    /// Consumes the builder and constructs a [`UpdateCertificateInput`](crate::operation::update_certificate::UpdateCertificateInput).
78    pub fn build(
79        self,
80    ) -> ::std::result::Result<crate::operation::update_certificate::UpdateCertificateInput, ::aws_smithy_types::error::operation::BuildError> {
81        ::std::result::Result::Ok(crate::operation::update_certificate::UpdateCertificateInput {
82            certificate_id: self.certificate_id,
83            new_status: self.new_status,
84        })
85    }
86}