aws_sdk_iotwireless/types/
_sidewalk_device.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Sidewalk device object.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SidewalkDevice {
7    /// <p>The Sidewalk Amazon ID.</p>
8    pub amazon_id: ::std::option::Option<::std::string::String>,
9    /// <p>The sidewalk device identification.</p>
10    pub sidewalk_id: ::std::option::Option<::std::string::String>,
11    /// <p>The Sidewalk manufacturing series number.</p>
12    pub sidewalk_manufacturing_sn: ::std::option::Option<::std::string::String>,
13    /// <p>The sidewalk device certificates for Ed25519 and P256r1.</p>
14    pub device_certificates: ::std::option::Option<::std::vec::Vec<crate::types::CertificateList>>,
15    /// <p>The Sidewalk device private keys that will be used for onboarding the device.</p>
16    pub private_keys: ::std::option::Option<::std::vec::Vec<crate::types::CertificateList>>,
17    /// <p>The ID of the Sidewalk device profile.</p>
18    pub device_profile_id: ::std::option::Option<::std::string::String>,
19    /// <p>The ID of the Sidewalk device profile.</p>
20    pub certificate_id: ::std::option::Option<::std::string::String>,
21    /// <p>The Sidewalk device status, such as provisioned or registered.</p>
22    pub status: ::std::option::Option<crate::types::WirelessDeviceSidewalkStatus>,
23}
24impl SidewalkDevice {
25    /// <p>The Sidewalk Amazon ID.</p>
26    pub fn amazon_id(&self) -> ::std::option::Option<&str> {
27        self.amazon_id.as_deref()
28    }
29    /// <p>The sidewalk device identification.</p>
30    pub fn sidewalk_id(&self) -> ::std::option::Option<&str> {
31        self.sidewalk_id.as_deref()
32    }
33    /// <p>The Sidewalk manufacturing series number.</p>
34    pub fn sidewalk_manufacturing_sn(&self) -> ::std::option::Option<&str> {
35        self.sidewalk_manufacturing_sn.as_deref()
36    }
37    /// <p>The sidewalk device certificates for Ed25519 and P256r1.</p>
38    ///
39    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.device_certificates.is_none()`.
40    pub fn device_certificates(&self) -> &[crate::types::CertificateList] {
41        self.device_certificates.as_deref().unwrap_or_default()
42    }
43    /// <p>The Sidewalk device private keys that will be used for onboarding the device.</p>
44    ///
45    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.private_keys.is_none()`.
46    pub fn private_keys(&self) -> &[crate::types::CertificateList] {
47        self.private_keys.as_deref().unwrap_or_default()
48    }
49    /// <p>The ID of the Sidewalk device profile.</p>
50    pub fn device_profile_id(&self) -> ::std::option::Option<&str> {
51        self.device_profile_id.as_deref()
52    }
53    /// <p>The ID of the Sidewalk device profile.</p>
54    pub fn certificate_id(&self) -> ::std::option::Option<&str> {
55        self.certificate_id.as_deref()
56    }
57    /// <p>The Sidewalk device status, such as provisioned or registered.</p>
58    pub fn status(&self) -> ::std::option::Option<&crate::types::WirelessDeviceSidewalkStatus> {
59        self.status.as_ref()
60    }
61}
62impl SidewalkDevice {
63    /// Creates a new builder-style object to manufacture [`SidewalkDevice`](crate::types::SidewalkDevice).
64    pub fn builder() -> crate::types::builders::SidewalkDeviceBuilder {
65        crate::types::builders::SidewalkDeviceBuilder::default()
66    }
67}
68
69/// A builder for [`SidewalkDevice`](crate::types::SidewalkDevice).
70#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
71#[non_exhaustive]
72pub struct SidewalkDeviceBuilder {
73    pub(crate) amazon_id: ::std::option::Option<::std::string::String>,
74    pub(crate) sidewalk_id: ::std::option::Option<::std::string::String>,
75    pub(crate) sidewalk_manufacturing_sn: ::std::option::Option<::std::string::String>,
76    pub(crate) device_certificates: ::std::option::Option<::std::vec::Vec<crate::types::CertificateList>>,
77    pub(crate) private_keys: ::std::option::Option<::std::vec::Vec<crate::types::CertificateList>>,
78    pub(crate) device_profile_id: ::std::option::Option<::std::string::String>,
79    pub(crate) certificate_id: ::std::option::Option<::std::string::String>,
80    pub(crate) status: ::std::option::Option<crate::types::WirelessDeviceSidewalkStatus>,
81}
82impl SidewalkDeviceBuilder {
83    /// <p>The Sidewalk Amazon ID.</p>
84    pub fn amazon_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85        self.amazon_id = ::std::option::Option::Some(input.into());
86        self
87    }
88    /// <p>The Sidewalk Amazon ID.</p>
89    pub fn set_amazon_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.amazon_id = input;
91        self
92    }
93    /// <p>The Sidewalk Amazon ID.</p>
94    pub fn get_amazon_id(&self) -> &::std::option::Option<::std::string::String> {
95        &self.amazon_id
96    }
97    /// <p>The sidewalk device identification.</p>
98    pub fn sidewalk_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99        self.sidewalk_id = ::std::option::Option::Some(input.into());
100        self
101    }
102    /// <p>The sidewalk device identification.</p>
103    pub fn set_sidewalk_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104        self.sidewalk_id = input;
105        self
106    }
107    /// <p>The sidewalk device identification.</p>
108    pub fn get_sidewalk_id(&self) -> &::std::option::Option<::std::string::String> {
109        &self.sidewalk_id
110    }
111    /// <p>The Sidewalk manufacturing series number.</p>
112    pub fn sidewalk_manufacturing_sn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.sidewalk_manufacturing_sn = ::std::option::Option::Some(input.into());
114        self
115    }
116    /// <p>The Sidewalk manufacturing series number.</p>
117    pub fn set_sidewalk_manufacturing_sn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.sidewalk_manufacturing_sn = input;
119        self
120    }
121    /// <p>The Sidewalk manufacturing series number.</p>
122    pub fn get_sidewalk_manufacturing_sn(&self) -> &::std::option::Option<::std::string::String> {
123        &self.sidewalk_manufacturing_sn
124    }
125    /// Appends an item to `device_certificates`.
126    ///
127    /// To override the contents of this collection use [`set_device_certificates`](Self::set_device_certificates).
128    ///
129    /// <p>The sidewalk device certificates for Ed25519 and P256r1.</p>
130    pub fn device_certificates(mut self, input: crate::types::CertificateList) -> Self {
131        let mut v = self.device_certificates.unwrap_or_default();
132        v.push(input);
133        self.device_certificates = ::std::option::Option::Some(v);
134        self
135    }
136    /// <p>The sidewalk device certificates for Ed25519 and P256r1.</p>
137    pub fn set_device_certificates(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CertificateList>>) -> Self {
138        self.device_certificates = input;
139        self
140    }
141    /// <p>The sidewalk device certificates for Ed25519 and P256r1.</p>
142    pub fn get_device_certificates(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CertificateList>> {
143        &self.device_certificates
144    }
145    /// Appends an item to `private_keys`.
146    ///
147    /// To override the contents of this collection use [`set_private_keys`](Self::set_private_keys).
148    ///
149    /// <p>The Sidewalk device private keys that will be used for onboarding the device.</p>
150    pub fn private_keys(mut self, input: crate::types::CertificateList) -> Self {
151        let mut v = self.private_keys.unwrap_or_default();
152        v.push(input);
153        self.private_keys = ::std::option::Option::Some(v);
154        self
155    }
156    /// <p>The Sidewalk device private keys that will be used for onboarding the device.</p>
157    pub fn set_private_keys(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CertificateList>>) -> Self {
158        self.private_keys = input;
159        self
160    }
161    /// <p>The Sidewalk device private keys that will be used for onboarding the device.</p>
162    pub fn get_private_keys(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CertificateList>> {
163        &self.private_keys
164    }
165    /// <p>The ID of the Sidewalk device profile.</p>
166    pub fn device_profile_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.device_profile_id = ::std::option::Option::Some(input.into());
168        self
169    }
170    /// <p>The ID of the Sidewalk device profile.</p>
171    pub fn set_device_profile_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.device_profile_id = input;
173        self
174    }
175    /// <p>The ID of the Sidewalk device profile.</p>
176    pub fn get_device_profile_id(&self) -> &::std::option::Option<::std::string::String> {
177        &self.device_profile_id
178    }
179    /// <p>The ID of the Sidewalk device profile.</p>
180    pub fn certificate_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
181        self.certificate_id = ::std::option::Option::Some(input.into());
182        self
183    }
184    /// <p>The ID of the Sidewalk device profile.</p>
185    pub fn set_certificate_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186        self.certificate_id = input;
187        self
188    }
189    /// <p>The ID of the Sidewalk device profile.</p>
190    pub fn get_certificate_id(&self) -> &::std::option::Option<::std::string::String> {
191        &self.certificate_id
192    }
193    /// <p>The Sidewalk device status, such as provisioned or registered.</p>
194    pub fn status(mut self, input: crate::types::WirelessDeviceSidewalkStatus) -> Self {
195        self.status = ::std::option::Option::Some(input);
196        self
197    }
198    /// <p>The Sidewalk device status, such as provisioned or registered.</p>
199    pub fn set_status(mut self, input: ::std::option::Option<crate::types::WirelessDeviceSidewalkStatus>) -> Self {
200        self.status = input;
201        self
202    }
203    /// <p>The Sidewalk device status, such as provisioned or registered.</p>
204    pub fn get_status(&self) -> &::std::option::Option<crate::types::WirelessDeviceSidewalkStatus> {
205        &self.status
206    }
207    /// Consumes the builder and constructs a [`SidewalkDevice`](crate::types::SidewalkDevice).
208    pub fn build(self) -> crate::types::SidewalkDevice {
209        crate::types::SidewalkDevice {
210            amazon_id: self.amazon_id,
211            sidewalk_id: self.sidewalk_id,
212            sidewalk_manufacturing_sn: self.sidewalk_manufacturing_sn,
213            device_certificates: self.device_certificates,
214            private_keys: self.private_keys,
215            device_profile_id: self.device_profile_id,
216            certificate_id: self.certificate_id,
217            status: self.status,
218        }
219    }
220}