1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The output from the DescribeThing operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DescribeThingOutput {
    /// <p>The default MQTT client ID. For a typical device, the thing name is also used as the default MQTT client ID. Although we don’t require a mapping between a thing's registry name and its use of MQTT client IDs, certificates, or shadow state, we recommend that you choose a thing name and use it as the MQTT client ID for the registry and the Device Shadow service.</p>
    /// <p>This lets you better organize your IoT fleet without removing the flexibility of the underlying device certificate model or shadows.</p>
    pub default_client_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the thing.</p>
    pub thing_name: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the thing to describe.</p>
    pub thing_id: ::std::option::Option<::std::string::String>,
    /// <p>The ARN of the thing to describe.</p>
    pub thing_arn: ::std::option::Option<::std::string::String>,
    /// <p>The thing type name.</p>
    pub thing_type_name: ::std::option::Option<::std::string::String>,
    /// <p>The thing attributes.</p>
    pub attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>The current version of the thing record in the registry.</p><note>
    /// <p>To avoid unintentional changes to the information in the registry, you can pass the version information in the <code>expectedVersion</code> parameter of the <code>UpdateThing</code> and <code>DeleteThing</code> calls.</p>
    /// </note>
    pub version: i64,
    /// <p>The name of the billing group the thing belongs to.</p>
    pub billing_group_name: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl DescribeThingOutput {
    /// <p>The default MQTT client ID. For a typical device, the thing name is also used as the default MQTT client ID. Although we don’t require a mapping between a thing's registry name and its use of MQTT client IDs, certificates, or shadow state, we recommend that you choose a thing name and use it as the MQTT client ID for the registry and the Device Shadow service.</p>
    /// <p>This lets you better organize your IoT fleet without removing the flexibility of the underlying device certificate model or shadows.</p>
    pub fn default_client_id(&self) -> ::std::option::Option<&str> {
        self.default_client_id.as_deref()
    }
    /// <p>The name of the thing.</p>
    pub fn thing_name(&self) -> ::std::option::Option<&str> {
        self.thing_name.as_deref()
    }
    /// <p>The ID of the thing to describe.</p>
    pub fn thing_id(&self) -> ::std::option::Option<&str> {
        self.thing_id.as_deref()
    }
    /// <p>The ARN of the thing to describe.</p>
    pub fn thing_arn(&self) -> ::std::option::Option<&str> {
        self.thing_arn.as_deref()
    }
    /// <p>The thing type name.</p>
    pub fn thing_type_name(&self) -> ::std::option::Option<&str> {
        self.thing_type_name.as_deref()
    }
    /// <p>The thing attributes.</p>
    pub fn attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.attributes.as_ref()
    }
    /// <p>The current version of the thing record in the registry.</p><note>
    /// <p>To avoid unintentional changes to the information in the registry, you can pass the version information in the <code>expectedVersion</code> parameter of the <code>UpdateThing</code> and <code>DeleteThing</code> calls.</p>
    /// </note>
    pub fn version(&self) -> i64 {
        self.version
    }
    /// <p>The name of the billing group the thing belongs to.</p>
    pub fn billing_group_name(&self) -> ::std::option::Option<&str> {
        self.billing_group_name.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for DescribeThingOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribeThingOutput {
    /// Creates a new builder-style object to manufacture [`DescribeThingOutput`](crate::operation::describe_thing::DescribeThingOutput).
    pub fn builder() -> crate::operation::describe_thing::builders::DescribeThingOutputBuilder {
        crate::operation::describe_thing::builders::DescribeThingOutputBuilder::default()
    }
}

/// A builder for [`DescribeThingOutput`](crate::operation::describe_thing::DescribeThingOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct DescribeThingOutputBuilder {
    pub(crate) default_client_id: ::std::option::Option<::std::string::String>,
    pub(crate) thing_name: ::std::option::Option<::std::string::String>,
    pub(crate) thing_id: ::std::option::Option<::std::string::String>,
    pub(crate) thing_arn: ::std::option::Option<::std::string::String>,
    pub(crate) thing_type_name: ::std::option::Option<::std::string::String>,
    pub(crate) attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) version: ::std::option::Option<i64>,
    pub(crate) billing_group_name: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl DescribeThingOutputBuilder {
    /// <p>The default MQTT client ID. For a typical device, the thing name is also used as the default MQTT client ID. Although we don’t require a mapping between a thing's registry name and its use of MQTT client IDs, certificates, or shadow state, we recommend that you choose a thing name and use it as the MQTT client ID for the registry and the Device Shadow service.</p>
    /// <p>This lets you better organize your IoT fleet without removing the flexibility of the underlying device certificate model or shadows.</p>
    pub fn default_client_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.default_client_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The default MQTT client ID. For a typical device, the thing name is also used as the default MQTT client ID. Although we don’t require a mapping between a thing's registry name and its use of MQTT client IDs, certificates, or shadow state, we recommend that you choose a thing name and use it as the MQTT client ID for the registry and the Device Shadow service.</p>
    /// <p>This lets you better organize your IoT fleet without removing the flexibility of the underlying device certificate model or shadows.</p>
    pub fn set_default_client_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.default_client_id = input;
        self
    }
    /// <p>The default MQTT client ID. For a typical device, the thing name is also used as the default MQTT client ID. Although we don’t require a mapping between a thing's registry name and its use of MQTT client IDs, certificates, or shadow state, we recommend that you choose a thing name and use it as the MQTT client ID for the registry and the Device Shadow service.</p>
    /// <p>This lets you better organize your IoT fleet without removing the flexibility of the underlying device certificate model or shadows.</p>
    pub fn get_default_client_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.default_client_id
    }
    /// <p>The name of the thing.</p>
    pub fn thing_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.thing_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the thing.</p>
    pub fn set_thing_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.thing_name = input;
        self
    }
    /// <p>The name of the thing.</p>
    pub fn get_thing_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.thing_name
    }
    /// <p>The ID of the thing to describe.</p>
    pub fn thing_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.thing_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the thing to describe.</p>
    pub fn set_thing_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.thing_id = input;
        self
    }
    /// <p>The ID of the thing to describe.</p>
    pub fn get_thing_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.thing_id
    }
    /// <p>The ARN of the thing to describe.</p>
    pub fn thing_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.thing_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the thing to describe.</p>
    pub fn set_thing_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.thing_arn = input;
        self
    }
    /// <p>The ARN of the thing to describe.</p>
    pub fn get_thing_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.thing_arn
    }
    /// <p>The thing type name.</p>
    pub fn thing_type_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.thing_type_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The thing type name.</p>
    pub fn set_thing_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.thing_type_name = input;
        self
    }
    /// <p>The thing type name.</p>
    pub fn get_thing_type_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.thing_type_name
    }
    /// Adds a key-value pair to `attributes`.
    ///
    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
    ///
    /// <p>The thing attributes.</p>
    pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.attributes.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.attributes = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The thing attributes.</p>
    pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.attributes = input;
        self
    }
    /// <p>The thing attributes.</p>
    pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.attributes
    }
    /// <p>The current version of the thing record in the registry.</p><note>
    /// <p>To avoid unintentional changes to the information in the registry, you can pass the version information in the <code>expectedVersion</code> parameter of the <code>UpdateThing</code> and <code>DeleteThing</code> calls.</p>
    /// </note>
    pub fn version(mut self, input: i64) -> Self {
        self.version = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current version of the thing record in the registry.</p><note>
    /// <p>To avoid unintentional changes to the information in the registry, you can pass the version information in the <code>expectedVersion</code> parameter of the <code>UpdateThing</code> and <code>DeleteThing</code> calls.</p>
    /// </note>
    pub fn set_version(mut self, input: ::std::option::Option<i64>) -> Self {
        self.version = input;
        self
    }
    /// <p>The current version of the thing record in the registry.</p><note>
    /// <p>To avoid unintentional changes to the information in the registry, you can pass the version information in the <code>expectedVersion</code> parameter of the <code>UpdateThing</code> and <code>DeleteThing</code> calls.</p>
    /// </note>
    pub fn get_version(&self) -> &::std::option::Option<i64> {
        &self.version
    }
    /// <p>The name of the billing group the thing belongs to.</p>
    pub fn billing_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.billing_group_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the billing group the thing belongs to.</p>
    pub fn set_billing_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.billing_group_name = input;
        self
    }
    /// <p>The name of the billing group the thing belongs to.</p>
    pub fn get_billing_group_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.billing_group_name
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`DescribeThingOutput`](crate::operation::describe_thing::DescribeThingOutput).
    pub fn build(self) -> crate::operation::describe_thing::DescribeThingOutput {
        crate::operation::describe_thing::DescribeThingOutput {
            default_client_id: self.default_client_id,
            thing_name: self.thing_name,
            thing_id: self.thing_id,
            thing_arn: self.thing_arn,
            thing_type_name: self.thing_type_name,
            attributes: self.attributes,
            version: self.version.unwrap_or_default(),
            billing_group_name: self.billing_group_name,
            _request_id: self._request_id,
        }
    }
}