aws_sdk_sagemaker/types/
_device.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information of a particular device.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Device {
7    /// <p>The name of the device.</p>
8    pub device_name: ::std::option::Option<::std::string::String>,
9    /// <p>Description of the device.</p>
10    pub description: ::std::option::Option<::std::string::String>,
11    /// <p>Amazon Web Services Internet of Things (IoT) object name.</p>
12    pub iot_thing_name: ::std::option::Option<::std::string::String>,
13}
14impl Device {
15    /// <p>The name of the device.</p>
16    pub fn device_name(&self) -> ::std::option::Option<&str> {
17        self.device_name.as_deref()
18    }
19    /// <p>Description of the device.</p>
20    pub fn description(&self) -> ::std::option::Option<&str> {
21        self.description.as_deref()
22    }
23    /// <p>Amazon Web Services Internet of Things (IoT) object name.</p>
24    pub fn iot_thing_name(&self) -> ::std::option::Option<&str> {
25        self.iot_thing_name.as_deref()
26    }
27}
28impl Device {
29    /// Creates a new builder-style object to manufacture [`Device`](crate::types::Device).
30    pub fn builder() -> crate::types::builders::DeviceBuilder {
31        crate::types::builders::DeviceBuilder::default()
32    }
33}
34
35/// A builder for [`Device`](crate::types::Device).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct DeviceBuilder {
39    pub(crate) device_name: ::std::option::Option<::std::string::String>,
40    pub(crate) description: ::std::option::Option<::std::string::String>,
41    pub(crate) iot_thing_name: ::std::option::Option<::std::string::String>,
42}
43impl DeviceBuilder {
44    /// <p>The name of the device.</p>
45    /// This field is required.
46    pub fn device_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.device_name = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// <p>The name of the device.</p>
51    pub fn set_device_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.device_name = input;
53        self
54    }
55    /// <p>The name of the device.</p>
56    pub fn get_device_name(&self) -> &::std::option::Option<::std::string::String> {
57        &self.device_name
58    }
59    /// <p>Description of the device.</p>
60    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.description = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>Description of the device.</p>
65    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.description = input;
67        self
68    }
69    /// <p>Description of the device.</p>
70    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
71        &self.description
72    }
73    /// <p>Amazon Web Services Internet of Things (IoT) object name.</p>
74    pub fn iot_thing_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.iot_thing_name = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>Amazon Web Services Internet of Things (IoT) object name.</p>
79    pub fn set_iot_thing_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.iot_thing_name = input;
81        self
82    }
83    /// <p>Amazon Web Services Internet of Things (IoT) object name.</p>
84    pub fn get_iot_thing_name(&self) -> &::std::option::Option<::std::string::String> {
85        &self.iot_thing_name
86    }
87    /// Consumes the builder and constructs a [`Device`](crate::types::Device).
88    pub fn build(self) -> crate::types::Device {
89        crate::types::Device {
90            device_name: self.device_name,
91            description: self.description,
92            iot_thing_name: self.iot_thing_name,
93        }
94    }
95}