aws_sdk_iot/operation/register_thing/
_register_thing_input.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 RegisterThingInput {
6    /// <p>The provisioning template. See <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-w-cert.html">Provisioning Devices That Have Device Certificates</a> for more information.</p>
7    pub template_body: ::std::option::Option<::std::string::String>,
8    /// <p>The parameters for provisioning a thing. See <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-template.html">Provisioning Templates</a> for more information.</p>
9    pub parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
10}
11impl RegisterThingInput {
12    /// <p>The provisioning template. See <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-w-cert.html">Provisioning Devices That Have Device Certificates</a> for more information.</p>
13    pub fn template_body(&self) -> ::std::option::Option<&str> {
14        self.template_body.as_deref()
15    }
16    /// <p>The parameters for provisioning a thing. See <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-template.html">Provisioning Templates</a> for more information.</p>
17    pub fn parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
18        self.parameters.as_ref()
19    }
20}
21impl RegisterThingInput {
22    /// Creates a new builder-style object to manufacture [`RegisterThingInput`](crate::operation::register_thing::RegisterThingInput).
23    pub fn builder() -> crate::operation::register_thing::builders::RegisterThingInputBuilder {
24        crate::operation::register_thing::builders::RegisterThingInputBuilder::default()
25    }
26}
27
28/// A builder for [`RegisterThingInput`](crate::operation::register_thing::RegisterThingInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct RegisterThingInputBuilder {
32    pub(crate) template_body: ::std::option::Option<::std::string::String>,
33    pub(crate) parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
34}
35impl RegisterThingInputBuilder {
36    /// <p>The provisioning template. See <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-w-cert.html">Provisioning Devices That Have Device Certificates</a> for more information.</p>
37    /// This field is required.
38    pub fn template_body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.template_body = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The provisioning template. See <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-w-cert.html">Provisioning Devices That Have Device Certificates</a> for more information.</p>
43    pub fn set_template_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.template_body = input;
45        self
46    }
47    /// <p>The provisioning template. See <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-w-cert.html">Provisioning Devices That Have Device Certificates</a> for more information.</p>
48    pub fn get_template_body(&self) -> &::std::option::Option<::std::string::String> {
49        &self.template_body
50    }
51    /// Adds a key-value pair to `parameters`.
52    ///
53    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
54    ///
55    /// <p>The parameters for provisioning a thing. See <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-template.html">Provisioning Templates</a> for more information.</p>
56    pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
57        let mut hash_map = self.parameters.unwrap_or_default();
58        hash_map.insert(k.into(), v.into());
59        self.parameters = ::std::option::Option::Some(hash_map);
60        self
61    }
62    /// <p>The parameters for provisioning a thing. See <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-template.html">Provisioning Templates</a> for more information.</p>
63    pub fn set_parameters(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
64        self.parameters = input;
65        self
66    }
67    /// <p>The parameters for provisioning a thing. See <a href="https://docs.aws.amazon.com/iot/latest/developerguide/provision-template.html">Provisioning Templates</a> for more information.</p>
68    pub fn get_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
69        &self.parameters
70    }
71    /// Consumes the builder and constructs a [`RegisterThingInput`](crate::operation::register_thing::RegisterThingInput).
72    pub fn build(
73        self,
74    ) -> ::std::result::Result<crate::operation::register_thing::RegisterThingInput, ::aws_smithy_types::error::operation::BuildError> {
75        ::std::result::Result::Ok(crate::operation::register_thing::RegisterThingInput {
76            template_body: self.template_body,
77            parameters: self.parameters,
78        })
79    }
80}