aws_sdk_iot/operation/register_thing/
_register_thing_output.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 RegisterThingOutput {
6    /// <p>The certificate data, in PEM format.</p>
7    pub certificate_pem: ::std::option::Option<::std::string::String>,
8    /// <p>ARNs for the generated resources.</p>
9    pub resource_arns: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
10    _request_id: Option<String>,
11}
12impl RegisterThingOutput {
13    /// <p>The certificate data, in PEM format.</p>
14    pub fn certificate_pem(&self) -> ::std::option::Option<&str> {
15        self.certificate_pem.as_deref()
16    }
17    /// <p>ARNs for the generated resources.</p>
18    pub fn resource_arns(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
19        self.resource_arns.as_ref()
20    }
21}
22impl ::aws_types::request_id::RequestId for RegisterThingOutput {
23    fn request_id(&self) -> Option<&str> {
24        self._request_id.as_deref()
25    }
26}
27impl RegisterThingOutput {
28    /// Creates a new builder-style object to manufacture [`RegisterThingOutput`](crate::operation::register_thing::RegisterThingOutput).
29    pub fn builder() -> crate::operation::register_thing::builders::RegisterThingOutputBuilder {
30        crate::operation::register_thing::builders::RegisterThingOutputBuilder::default()
31    }
32}
33
34/// A builder for [`RegisterThingOutput`](crate::operation::register_thing::RegisterThingOutput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct RegisterThingOutputBuilder {
38    pub(crate) certificate_pem: ::std::option::Option<::std::string::String>,
39    pub(crate) resource_arns: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
40    _request_id: Option<String>,
41}
42impl RegisterThingOutputBuilder {
43    /// <p>The certificate data, in PEM format.</p>
44    pub fn certificate_pem(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        self.certificate_pem = ::std::option::Option::Some(input.into());
46        self
47    }
48    /// <p>The certificate data, in PEM format.</p>
49    pub fn set_certificate_pem(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50        self.certificate_pem = input;
51        self
52    }
53    /// <p>The certificate data, in PEM format.</p>
54    pub fn get_certificate_pem(&self) -> &::std::option::Option<::std::string::String> {
55        &self.certificate_pem
56    }
57    /// Adds a key-value pair to `resource_arns`.
58    ///
59    /// To override the contents of this collection use [`set_resource_arns`](Self::set_resource_arns).
60    ///
61    /// <p>ARNs for the generated resources.</p>
62    pub fn resource_arns(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
63        let mut hash_map = self.resource_arns.unwrap_or_default();
64        hash_map.insert(k.into(), v.into());
65        self.resource_arns = ::std::option::Option::Some(hash_map);
66        self
67    }
68    /// <p>ARNs for the generated resources.</p>
69    pub fn set_resource_arns(
70        mut self,
71        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
72    ) -> Self {
73        self.resource_arns = input;
74        self
75    }
76    /// <p>ARNs for the generated resources.</p>
77    pub fn get_resource_arns(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
78        &self.resource_arns
79    }
80    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
81        self._request_id = Some(request_id.into());
82        self
83    }
84
85    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
86        self._request_id = request_id;
87        self
88    }
89    /// Consumes the builder and constructs a [`RegisterThingOutput`](crate::operation::register_thing::RegisterThingOutput).
90    pub fn build(self) -> crate::operation::register_thing::RegisterThingOutput {
91        crate::operation::register_thing::RegisterThingOutput {
92            certificate_pem: self.certificate_pem,
93            resource_arns: self.resource_arns,
94            _request_id: self._request_id,
95        }
96    }
97}