aws_sdk_iot/operation/create_thing/
_create_thing_input.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateThingInput {
7    pub thing_name: ::std::option::Option<::std::string::String>,
10    pub thing_type_name: ::std::option::Option<::std::string::String>,
12    pub attribute_payload: ::std::option::Option<crate::types::AttributePayload>,
15    pub billing_group_name: ::std::option::Option<::std::string::String>,
17}
18impl CreateThingInput {
19    pub fn thing_name(&self) -> ::std::option::Option<&str> {
22        self.thing_name.as_deref()
23    }
24    pub fn thing_type_name(&self) -> ::std::option::Option<&str> {
26        self.thing_type_name.as_deref()
27    }
28    pub fn attribute_payload(&self) -> ::std::option::Option<&crate::types::AttributePayload> {
31        self.attribute_payload.as_ref()
32    }
33    pub fn billing_group_name(&self) -> ::std::option::Option<&str> {
35        self.billing_group_name.as_deref()
36    }
37}
38impl CreateThingInput {
39    pub fn builder() -> crate::operation::create_thing::builders::CreateThingInputBuilder {
41        crate::operation::create_thing::builders::CreateThingInputBuilder::default()
42    }
43}
44
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
47#[non_exhaustive]
48pub struct CreateThingInputBuilder {
49    pub(crate) thing_name: ::std::option::Option<::std::string::String>,
50    pub(crate) thing_type_name: ::std::option::Option<::std::string::String>,
51    pub(crate) attribute_payload: ::std::option::Option<crate::types::AttributePayload>,
52    pub(crate) billing_group_name: ::std::option::Option<::std::string::String>,
53}
54impl CreateThingInputBuilder {
55    pub fn thing_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        self.thing_name = ::std::option::Option::Some(input.into());
60        self
61    }
62    pub fn set_thing_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.thing_name = input;
66        self
67    }
68    pub fn get_thing_name(&self) -> &::std::option::Option<::std::string::String> {
71        &self.thing_name
72    }
73    pub fn thing_type_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.thing_type_name = ::std::option::Option::Some(input.into());
76        self
77    }
78    pub fn set_thing_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.thing_type_name = input;
81        self
82    }
83    pub fn get_thing_type_name(&self) -> &::std::option::Option<::std::string::String> {
85        &self.thing_type_name
86    }
87    pub fn attribute_payload(mut self, input: crate::types::AttributePayload) -> Self {
90        self.attribute_payload = ::std::option::Option::Some(input);
91        self
92    }
93    pub fn set_attribute_payload(mut self, input: ::std::option::Option<crate::types::AttributePayload>) -> Self {
96        self.attribute_payload = input;
97        self
98    }
99    pub fn get_attribute_payload(&self) -> &::std::option::Option<crate::types::AttributePayload> {
102        &self.attribute_payload
103    }
104    pub fn billing_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.billing_group_name = ::std::option::Option::Some(input.into());
107        self
108    }
109    pub fn set_billing_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.billing_group_name = input;
112        self
113    }
114    pub fn get_billing_group_name(&self) -> &::std::option::Option<::std::string::String> {
116        &self.billing_group_name
117    }
118    pub fn build(self) -> ::std::result::Result<crate::operation::create_thing::CreateThingInput, ::aws_smithy_types::error::operation::BuildError> {
120        ::std::result::Result::Ok(crate::operation::create_thing::CreateThingInput {
121            thing_name: self.thing_name,
122            thing_type_name: self.thing_type_name,
123            attribute_payload: self.attribute_payload,
124            billing_group_name: self.billing_group_name,
125        })
126    }
127}