aws_sdk_iot/operation/describe_thing/
_describe_thing_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The output from the DescribeThing operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribeThingOutput {
7    /// <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>
8    /// <p>This lets you better organize your IoT fleet without removing the flexibility of the underlying device certificate model or shadows.</p>
9    pub default_client_id: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the thing.</p>
11    pub thing_name: ::std::option::Option<::std::string::String>,
12    /// <p>The ID of the thing to describe.</p>
13    pub thing_id: ::std::option::Option<::std::string::String>,
14    /// <p>The ARN of the thing to describe.</p>
15    pub thing_arn: ::std::option::Option<::std::string::String>,
16    /// <p>The thing type name.</p>
17    pub thing_type_name: ::std::option::Option<::std::string::String>,
18    /// <p>The thing attributes.</p>
19    pub attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
20    /// <p>The current version of the thing record in the registry.</p><note>
21    /// <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>
22    /// </note>
23    pub version: i64,
24    /// <p>The name of the billing group the thing belongs to.</p>
25    pub billing_group_name: ::std::option::Option<::std::string::String>,
26    _request_id: Option<String>,
27}
28impl DescribeThingOutput {
29    /// <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>
30    /// <p>This lets you better organize your IoT fleet without removing the flexibility of the underlying device certificate model or shadows.</p>
31    pub fn default_client_id(&self) -> ::std::option::Option<&str> {
32        self.default_client_id.as_deref()
33    }
34    /// <p>The name of the thing.</p>
35    pub fn thing_name(&self) -> ::std::option::Option<&str> {
36        self.thing_name.as_deref()
37    }
38    /// <p>The ID of the thing to describe.</p>
39    pub fn thing_id(&self) -> ::std::option::Option<&str> {
40        self.thing_id.as_deref()
41    }
42    /// <p>The ARN of the thing to describe.</p>
43    pub fn thing_arn(&self) -> ::std::option::Option<&str> {
44        self.thing_arn.as_deref()
45    }
46    /// <p>The thing type name.</p>
47    pub fn thing_type_name(&self) -> ::std::option::Option<&str> {
48        self.thing_type_name.as_deref()
49    }
50    /// <p>The thing attributes.</p>
51    pub fn attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
52        self.attributes.as_ref()
53    }
54    /// <p>The current version of the thing record in the registry.</p><note>
55    /// <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>
56    /// </note>
57    pub fn version(&self) -> i64 {
58        self.version
59    }
60    /// <p>The name of the billing group the thing belongs to.</p>
61    pub fn billing_group_name(&self) -> ::std::option::Option<&str> {
62        self.billing_group_name.as_deref()
63    }
64}
65impl ::aws_types::request_id::RequestId for DescribeThingOutput {
66    fn request_id(&self) -> Option<&str> {
67        self._request_id.as_deref()
68    }
69}
70impl DescribeThingOutput {
71    /// Creates a new builder-style object to manufacture [`DescribeThingOutput`](crate::operation::describe_thing::DescribeThingOutput).
72    pub fn builder() -> crate::operation::describe_thing::builders::DescribeThingOutputBuilder {
73        crate::operation::describe_thing::builders::DescribeThingOutputBuilder::default()
74    }
75}
76
77/// A builder for [`DescribeThingOutput`](crate::operation::describe_thing::DescribeThingOutput).
78#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
79#[non_exhaustive]
80pub struct DescribeThingOutputBuilder {
81    pub(crate) default_client_id: ::std::option::Option<::std::string::String>,
82    pub(crate) thing_name: ::std::option::Option<::std::string::String>,
83    pub(crate) thing_id: ::std::option::Option<::std::string::String>,
84    pub(crate) thing_arn: ::std::option::Option<::std::string::String>,
85    pub(crate) thing_type_name: ::std::option::Option<::std::string::String>,
86    pub(crate) attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
87    pub(crate) version: ::std::option::Option<i64>,
88    pub(crate) billing_group_name: ::std::option::Option<::std::string::String>,
89    _request_id: Option<String>,
90}
91impl DescribeThingOutputBuilder {
92    /// <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>
93    /// <p>This lets you better organize your IoT fleet without removing the flexibility of the underlying device certificate model or shadows.</p>
94    pub fn default_client_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.default_client_id = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <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>
99    /// <p>This lets you better organize your IoT fleet without removing the flexibility of the underlying device certificate model or shadows.</p>
100    pub fn set_default_client_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.default_client_id = input;
102        self
103    }
104    /// <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>
105    /// <p>This lets you better organize your IoT fleet without removing the flexibility of the underlying device certificate model or shadows.</p>
106    pub fn get_default_client_id(&self) -> &::std::option::Option<::std::string::String> {
107        &self.default_client_id
108    }
109    /// <p>The name of the thing.</p>
110    pub fn thing_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.thing_name = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>The name of the thing.</p>
115    pub fn set_thing_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.thing_name = input;
117        self
118    }
119    /// <p>The name of the thing.</p>
120    pub fn get_thing_name(&self) -> &::std::option::Option<::std::string::String> {
121        &self.thing_name
122    }
123    /// <p>The ID of the thing to describe.</p>
124    pub fn thing_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.thing_id = ::std::option::Option::Some(input.into());
126        self
127    }
128    /// <p>The ID of the thing to describe.</p>
129    pub fn set_thing_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.thing_id = input;
131        self
132    }
133    /// <p>The ID of the thing to describe.</p>
134    pub fn get_thing_id(&self) -> &::std::option::Option<::std::string::String> {
135        &self.thing_id
136    }
137    /// <p>The ARN of the thing to describe.</p>
138    pub fn thing_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.thing_arn = ::std::option::Option::Some(input.into());
140        self
141    }
142    /// <p>The ARN of the thing to describe.</p>
143    pub fn set_thing_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.thing_arn = input;
145        self
146    }
147    /// <p>The ARN of the thing to describe.</p>
148    pub fn get_thing_arn(&self) -> &::std::option::Option<::std::string::String> {
149        &self.thing_arn
150    }
151    /// <p>The thing type name.</p>
152    pub fn thing_type_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.thing_type_name = ::std::option::Option::Some(input.into());
154        self
155    }
156    /// <p>The thing type name.</p>
157    pub fn set_thing_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.thing_type_name = input;
159        self
160    }
161    /// <p>The thing type name.</p>
162    pub fn get_thing_type_name(&self) -> &::std::option::Option<::std::string::String> {
163        &self.thing_type_name
164    }
165    /// Adds a key-value pair to `attributes`.
166    ///
167    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
168    ///
169    /// <p>The thing attributes.</p>
170    pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
171        let mut hash_map = self.attributes.unwrap_or_default();
172        hash_map.insert(k.into(), v.into());
173        self.attributes = ::std::option::Option::Some(hash_map);
174        self
175    }
176    /// <p>The thing attributes.</p>
177    pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
178        self.attributes = input;
179        self
180    }
181    /// <p>The thing attributes.</p>
182    pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
183        &self.attributes
184    }
185    /// <p>The current version of the thing record in the registry.</p><note>
186    /// <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>
187    /// </note>
188    pub fn version(mut self, input: i64) -> Self {
189        self.version = ::std::option::Option::Some(input);
190        self
191    }
192    /// <p>The current version of the thing record in the registry.</p><note>
193    /// <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>
194    /// </note>
195    pub fn set_version(mut self, input: ::std::option::Option<i64>) -> Self {
196        self.version = input;
197        self
198    }
199    /// <p>The current version of the thing record in the registry.</p><note>
200    /// <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>
201    /// </note>
202    pub fn get_version(&self) -> &::std::option::Option<i64> {
203        &self.version
204    }
205    /// <p>The name of the billing group the thing belongs to.</p>
206    pub fn billing_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207        self.billing_group_name = ::std::option::Option::Some(input.into());
208        self
209    }
210    /// <p>The name of the billing group the thing belongs to.</p>
211    pub fn set_billing_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212        self.billing_group_name = input;
213        self
214    }
215    /// <p>The name of the billing group the thing belongs to.</p>
216    pub fn get_billing_group_name(&self) -> &::std::option::Option<::std::string::String> {
217        &self.billing_group_name
218    }
219    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
220        self._request_id = Some(request_id.into());
221        self
222    }
223
224    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
225        self._request_id = request_id;
226        self
227    }
228    /// Consumes the builder and constructs a [`DescribeThingOutput`](crate::operation::describe_thing::DescribeThingOutput).
229    pub fn build(self) -> crate::operation::describe_thing::DescribeThingOutput {
230        crate::operation::describe_thing::DescribeThingOutput {
231            default_client_id: self.default_client_id,
232            thing_name: self.thing_name,
233            thing_id: self.thing_id,
234            thing_arn: self.thing_arn,
235            thing_type_name: self.thing_type_name,
236            attributes: self.attributes,
237            version: self.version.unwrap_or_default(),
238            billing_group_name: self.billing_group_name,
239            _request_id: self._request_id,
240        }
241    }
242}