aws_sdk_iot/operation/delete_certificate/
_delete_certificate_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The input for the DeleteCertificate operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DeleteCertificateInput {
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>Forces the deletion of a certificate if it is inactive and is not attached to an IoT thing.</p>
10    pub force_delete: ::std::option::Option<bool>,
11}
12impl DeleteCertificateInput {
13    /// <p>The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</p>
14    pub fn certificate_id(&self) -> ::std::option::Option<&str> {
15        self.certificate_id.as_deref()
16    }
17    /// <p>Forces the deletion of a certificate if it is inactive and is not attached to an IoT thing.</p>
18    pub fn force_delete(&self) -> ::std::option::Option<bool> {
19        self.force_delete
20    }
21}
22impl DeleteCertificateInput {
23    /// Creates a new builder-style object to manufacture [`DeleteCertificateInput`](crate::operation::delete_certificate::DeleteCertificateInput).
24    pub fn builder() -> crate::operation::delete_certificate::builders::DeleteCertificateInputBuilder {
25        crate::operation::delete_certificate::builders::DeleteCertificateInputBuilder::default()
26    }
27}
28
29/// A builder for [`DeleteCertificateInput`](crate::operation::delete_certificate::DeleteCertificateInput).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct DeleteCertificateInputBuilder {
33    pub(crate) certificate_id: ::std::option::Option<::std::string::String>,
34    pub(crate) force_delete: ::std::option::Option<bool>,
35}
36impl DeleteCertificateInputBuilder {
37    /// <p>The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</p>
38    /// This field is required.
39    pub fn certificate_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
40        self.certificate_id = ::std::option::Option::Some(input.into());
41        self
42    }
43    /// <p>The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</p>
44    pub fn set_certificate_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
45        self.certificate_id = input;
46        self
47    }
48    /// <p>The ID of the certificate. (The last part of the certificate ARN contains the certificate ID.)</p>
49    pub fn get_certificate_id(&self) -> &::std::option::Option<::std::string::String> {
50        &self.certificate_id
51    }
52    /// <p>Forces the deletion of a certificate if it is inactive and is not attached to an IoT thing.</p>
53    pub fn force_delete(mut self, input: bool) -> Self {
54        self.force_delete = ::std::option::Option::Some(input);
55        self
56    }
57    /// <p>Forces the deletion of a certificate if it is inactive and is not attached to an IoT thing.</p>
58    pub fn set_force_delete(mut self, input: ::std::option::Option<bool>) -> Self {
59        self.force_delete = input;
60        self
61    }
62    /// <p>Forces the deletion of a certificate if it is inactive and is not attached to an IoT thing.</p>
63    pub fn get_force_delete(&self) -> &::std::option::Option<bool> {
64        &self.force_delete
65    }
66    /// Consumes the builder and constructs a [`DeleteCertificateInput`](crate::operation::delete_certificate::DeleteCertificateInput).
67    pub fn build(
68        self,
69    ) -> ::std::result::Result<crate::operation::delete_certificate::DeleteCertificateInput, ::aws_smithy_types::error::operation::BuildError> {
70        ::std::result::Result::Ok(crate::operation::delete_certificate::DeleteCertificateInput {
71            certificate_id: self.certificate_id,
72            force_delete: self.force_delete,
73        })
74    }
75}