aws_sdk_sagemaker/operation/describe_device/
_describe_device_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 DescribeDeviceOutput {
6    /// <p>The Amazon Resource Name (ARN) of the device.</p>
7    pub device_arn: ::std::option::Option<::std::string::String>,
8    /// <p>The unique identifier of the device.</p>
9    pub device_name: ::std::option::Option<::std::string::String>,
10    /// <p>A description of the device.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>The name of the fleet the device belongs to.</p>
13    pub device_fleet_name: ::std::option::Option<::std::string::String>,
14    /// <p>The Amazon Web Services Internet of Things (IoT) object thing name associated with the device.</p>
15    pub iot_thing_name: ::std::option::Option<::std::string::String>,
16    /// <p>The timestamp of the last registration or de-reregistration.</p>
17    pub registration_time: ::std::option::Option<::aws_smithy_types::DateTime>,
18    /// <p>The last heartbeat received from the device.</p>
19    pub latest_heartbeat: ::std::option::Option<::aws_smithy_types::DateTime>,
20    /// <p>Models on the device.</p>
21    pub models: ::std::option::Option<::std::vec::Vec<crate::types::EdgeModel>>,
22    /// <p>The maximum number of models.</p>
23    pub max_models: ::std::option::Option<i32>,
24    /// <p>The response from the last list when returning a list large enough to need tokening.</p>
25    pub next_token: ::std::option::Option<::std::string::String>,
26    /// <p>Edge Manager agent version.</p>
27    pub agent_version: ::std::option::Option<::std::string::String>,
28    _request_id: Option<String>,
29}
30impl DescribeDeviceOutput {
31    /// <p>The Amazon Resource Name (ARN) of the device.</p>
32    pub fn device_arn(&self) -> ::std::option::Option<&str> {
33        self.device_arn.as_deref()
34    }
35    /// <p>The unique identifier of the device.</p>
36    pub fn device_name(&self) -> ::std::option::Option<&str> {
37        self.device_name.as_deref()
38    }
39    /// <p>A description of the device.</p>
40    pub fn description(&self) -> ::std::option::Option<&str> {
41        self.description.as_deref()
42    }
43    /// <p>The name of the fleet the device belongs to.</p>
44    pub fn device_fleet_name(&self) -> ::std::option::Option<&str> {
45        self.device_fleet_name.as_deref()
46    }
47    /// <p>The Amazon Web Services Internet of Things (IoT) object thing name associated with the device.</p>
48    pub fn iot_thing_name(&self) -> ::std::option::Option<&str> {
49        self.iot_thing_name.as_deref()
50    }
51    /// <p>The timestamp of the last registration or de-reregistration.</p>
52    pub fn registration_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
53        self.registration_time.as_ref()
54    }
55    /// <p>The last heartbeat received from the device.</p>
56    pub fn latest_heartbeat(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
57        self.latest_heartbeat.as_ref()
58    }
59    /// <p>Models on the device.</p>
60    ///
61    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.models.is_none()`.
62    pub fn models(&self) -> &[crate::types::EdgeModel] {
63        self.models.as_deref().unwrap_or_default()
64    }
65    /// <p>The maximum number of models.</p>
66    pub fn max_models(&self) -> ::std::option::Option<i32> {
67        self.max_models
68    }
69    /// <p>The response from the last list when returning a list large enough to need tokening.</p>
70    pub fn next_token(&self) -> ::std::option::Option<&str> {
71        self.next_token.as_deref()
72    }
73    /// <p>Edge Manager agent version.</p>
74    pub fn agent_version(&self) -> ::std::option::Option<&str> {
75        self.agent_version.as_deref()
76    }
77}
78impl ::aws_types::request_id::RequestId for DescribeDeviceOutput {
79    fn request_id(&self) -> Option<&str> {
80        self._request_id.as_deref()
81    }
82}
83impl DescribeDeviceOutput {
84    /// Creates a new builder-style object to manufacture [`DescribeDeviceOutput`](crate::operation::describe_device::DescribeDeviceOutput).
85    pub fn builder() -> crate::operation::describe_device::builders::DescribeDeviceOutputBuilder {
86        crate::operation::describe_device::builders::DescribeDeviceOutputBuilder::default()
87    }
88}
89
90/// A builder for [`DescribeDeviceOutput`](crate::operation::describe_device::DescribeDeviceOutput).
91#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
92#[non_exhaustive]
93pub struct DescribeDeviceOutputBuilder {
94    pub(crate) device_arn: ::std::option::Option<::std::string::String>,
95    pub(crate) device_name: ::std::option::Option<::std::string::String>,
96    pub(crate) description: ::std::option::Option<::std::string::String>,
97    pub(crate) device_fleet_name: ::std::option::Option<::std::string::String>,
98    pub(crate) iot_thing_name: ::std::option::Option<::std::string::String>,
99    pub(crate) registration_time: ::std::option::Option<::aws_smithy_types::DateTime>,
100    pub(crate) latest_heartbeat: ::std::option::Option<::aws_smithy_types::DateTime>,
101    pub(crate) models: ::std::option::Option<::std::vec::Vec<crate::types::EdgeModel>>,
102    pub(crate) max_models: ::std::option::Option<i32>,
103    pub(crate) next_token: ::std::option::Option<::std::string::String>,
104    pub(crate) agent_version: ::std::option::Option<::std::string::String>,
105    _request_id: Option<String>,
106}
107impl DescribeDeviceOutputBuilder {
108    /// <p>The Amazon Resource Name (ARN) of the device.</p>
109    pub fn device_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.device_arn = ::std::option::Option::Some(input.into());
111        self
112    }
113    /// <p>The Amazon Resource Name (ARN) of the device.</p>
114    pub fn set_device_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.device_arn = input;
116        self
117    }
118    /// <p>The Amazon Resource Name (ARN) of the device.</p>
119    pub fn get_device_arn(&self) -> &::std::option::Option<::std::string::String> {
120        &self.device_arn
121    }
122    /// <p>The unique identifier of the device.</p>
123    /// This field is required.
124    pub fn device_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.device_name = ::std::option::Option::Some(input.into());
126        self
127    }
128    /// <p>The unique identifier of the device.</p>
129    pub fn set_device_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.device_name = input;
131        self
132    }
133    /// <p>The unique identifier of the device.</p>
134    pub fn get_device_name(&self) -> &::std::option::Option<::std::string::String> {
135        &self.device_name
136    }
137    /// <p>A description of the device.</p>
138    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.description = ::std::option::Option::Some(input.into());
140        self
141    }
142    /// <p>A description of the device.</p>
143    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.description = input;
145        self
146    }
147    /// <p>A description of the device.</p>
148    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
149        &self.description
150    }
151    /// <p>The name of the fleet the device belongs to.</p>
152    /// This field is required.
153    pub fn device_fleet_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.device_fleet_name = ::std::option::Option::Some(input.into());
155        self
156    }
157    /// <p>The name of the fleet the device belongs to.</p>
158    pub fn set_device_fleet_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.device_fleet_name = input;
160        self
161    }
162    /// <p>The name of the fleet the device belongs to.</p>
163    pub fn get_device_fleet_name(&self) -> &::std::option::Option<::std::string::String> {
164        &self.device_fleet_name
165    }
166    /// <p>The Amazon Web Services Internet of Things (IoT) object thing name associated with the device.</p>
167    pub fn iot_thing_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168        self.iot_thing_name = ::std::option::Option::Some(input.into());
169        self
170    }
171    /// <p>The Amazon Web Services Internet of Things (IoT) object thing name associated with the device.</p>
172    pub fn set_iot_thing_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173        self.iot_thing_name = input;
174        self
175    }
176    /// <p>The Amazon Web Services Internet of Things (IoT) object thing name associated with the device.</p>
177    pub fn get_iot_thing_name(&self) -> &::std::option::Option<::std::string::String> {
178        &self.iot_thing_name
179    }
180    /// <p>The timestamp of the last registration or de-reregistration.</p>
181    /// This field is required.
182    pub fn registration_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
183        self.registration_time = ::std::option::Option::Some(input);
184        self
185    }
186    /// <p>The timestamp of the last registration or de-reregistration.</p>
187    pub fn set_registration_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
188        self.registration_time = input;
189        self
190    }
191    /// <p>The timestamp of the last registration or de-reregistration.</p>
192    pub fn get_registration_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
193        &self.registration_time
194    }
195    /// <p>The last heartbeat received from the device.</p>
196    pub fn latest_heartbeat(mut self, input: ::aws_smithy_types::DateTime) -> Self {
197        self.latest_heartbeat = ::std::option::Option::Some(input);
198        self
199    }
200    /// <p>The last heartbeat received from the device.</p>
201    pub fn set_latest_heartbeat(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
202        self.latest_heartbeat = input;
203        self
204    }
205    /// <p>The last heartbeat received from the device.</p>
206    pub fn get_latest_heartbeat(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
207        &self.latest_heartbeat
208    }
209    /// Appends an item to `models`.
210    ///
211    /// To override the contents of this collection use [`set_models`](Self::set_models).
212    ///
213    /// <p>Models on the device.</p>
214    pub fn models(mut self, input: crate::types::EdgeModel) -> Self {
215        let mut v = self.models.unwrap_or_default();
216        v.push(input);
217        self.models = ::std::option::Option::Some(v);
218        self
219    }
220    /// <p>Models on the device.</p>
221    pub fn set_models(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EdgeModel>>) -> Self {
222        self.models = input;
223        self
224    }
225    /// <p>Models on the device.</p>
226    pub fn get_models(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EdgeModel>> {
227        &self.models
228    }
229    /// <p>The maximum number of models.</p>
230    pub fn max_models(mut self, input: i32) -> Self {
231        self.max_models = ::std::option::Option::Some(input);
232        self
233    }
234    /// <p>The maximum number of models.</p>
235    pub fn set_max_models(mut self, input: ::std::option::Option<i32>) -> Self {
236        self.max_models = input;
237        self
238    }
239    /// <p>The maximum number of models.</p>
240    pub fn get_max_models(&self) -> &::std::option::Option<i32> {
241        &self.max_models
242    }
243    /// <p>The response from the last list when returning a list large enough to need tokening.</p>
244    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
245        self.next_token = ::std::option::Option::Some(input.into());
246        self
247    }
248    /// <p>The response from the last list when returning a list large enough to need tokening.</p>
249    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
250        self.next_token = input;
251        self
252    }
253    /// <p>The response from the last list when returning a list large enough to need tokening.</p>
254    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
255        &self.next_token
256    }
257    /// <p>Edge Manager agent version.</p>
258    pub fn agent_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
259        self.agent_version = ::std::option::Option::Some(input.into());
260        self
261    }
262    /// <p>Edge Manager agent version.</p>
263    pub fn set_agent_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
264        self.agent_version = input;
265        self
266    }
267    /// <p>Edge Manager agent version.</p>
268    pub fn get_agent_version(&self) -> &::std::option::Option<::std::string::String> {
269        &self.agent_version
270    }
271    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
272        self._request_id = Some(request_id.into());
273        self
274    }
275
276    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
277        self._request_id = request_id;
278        self
279    }
280    /// Consumes the builder and constructs a [`DescribeDeviceOutput`](crate::operation::describe_device::DescribeDeviceOutput).
281    pub fn build(self) -> crate::operation::describe_device::DescribeDeviceOutput {
282        crate::operation::describe_device::DescribeDeviceOutput {
283            device_arn: self.device_arn,
284            device_name: self.device_name,
285            description: self.description,
286            device_fleet_name: self.device_fleet_name,
287            iot_thing_name: self.iot_thing_name,
288            registration_time: self.registration_time,
289            latest_heartbeat: self.latest_heartbeat,
290            models: self.models,
291            max_models: self.max_models,
292            next_token: self.next_token,
293            agent_version: self.agent_version,
294            _request_id: self._request_id,
295        }
296    }
297}