1#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct WritableDeviceWithConfigContextRequest {
15 #[serde(
16 rename = "name",
17 default,
18 with = "::serde_with::rust::double_option",
19 skip_serializing_if = "Option::is_none"
20 )]
21 pub name: Option<Option<String>>,
22 #[serde(rename = "device_type")]
23 pub device_type: Box<crate::models::DeviceBayTemplateRequestDeviceType>,
24 #[serde(rename = "role")]
25 pub role: Box<crate::models::DeviceWithConfigContextRequestRole>,
26 #[serde(
27 rename = "tenant",
28 default,
29 with = "::serde_with::rust::double_option",
30 skip_serializing_if = "Option::is_none"
31 )]
32 pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
33 #[serde(
34 rename = "platform",
35 default,
36 with = "::serde_with::rust::double_option",
37 skip_serializing_if = "Option::is_none"
38 )]
39 pub platform: Option<Option<Box<crate::models::DeviceTypeRequestDefaultPlatform>>>,
40 #[serde(rename = "serial", skip_serializing_if = "Option::is_none")]
42 pub serial: Option<String>,
43 #[serde(
45 rename = "asset_tag",
46 default,
47 with = "::serde_with::rust::double_option",
48 skip_serializing_if = "Option::is_none"
49 )]
50 pub asset_tag: Option<Option<String>>,
51 #[serde(rename = "site")]
52 pub site: Box<crate::models::DeviceWithConfigContextRequestSite>,
53 #[serde(
54 rename = "location",
55 default,
56 with = "::serde_with::rust::double_option",
57 skip_serializing_if = "Option::is_none"
58 )]
59 pub location: Option<Option<Box<crate::models::DeviceWithConfigContextRequestLocation>>>,
60 #[serde(
61 rename = "rack",
62 default,
63 with = "::serde_with::rust::double_option",
64 skip_serializing_if = "Option::is_none"
65 )]
66 pub rack: Option<Option<Box<crate::models::DeviceWithConfigContextRequestRack>>>,
67 #[serde(
68 rename = "position",
69 default,
70 with = "::serde_with::rust::double_option",
71 skip_serializing_if = "Option::is_none"
72 )]
73 pub position: Option<Option<f64>>,
74 #[serde(
76 rename = "face",
77 default,
78 with = "::serde_with::rust::double_option",
79 skip_serializing_if = "Option::is_none"
80 )]
81 pub face: Option<Option<Face>>,
82 #[serde(
84 rename = "latitude",
85 default,
86 with = "::serde_with::rust::double_option",
87 skip_serializing_if = "Option::is_none"
88 )]
89 pub latitude: Option<Option<f64>>,
90 #[serde(
92 rename = "longitude",
93 default,
94 with = "::serde_with::rust::double_option",
95 skip_serializing_if = "Option::is_none"
96 )]
97 pub longitude: Option<Option<f64>>,
98 #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
100 pub status: Option<Status>,
101 #[serde(
103 rename = "airflow",
104 default,
105 with = "::serde_with::rust::double_option",
106 skip_serializing_if = "Option::is_none"
107 )]
108 pub airflow: Option<Option<Airflow>>,
109 #[serde(
110 rename = "primary_ip4",
111 default,
112 with = "::serde_with::rust::double_option",
113 skip_serializing_if = "Option::is_none"
114 )]
115 pub primary_ip4: Option<Option<Box<crate::models::DeviceWithConfigContextRequestPrimaryIp4>>>,
116 #[serde(
117 rename = "primary_ip6",
118 default,
119 with = "::serde_with::rust::double_option",
120 skip_serializing_if = "Option::is_none"
121 )]
122 pub primary_ip6: Option<Option<Box<crate::models::DeviceWithConfigContextRequestPrimaryIp4>>>,
123 #[serde(
124 rename = "oob_ip",
125 default,
126 with = "::serde_with::rust::double_option",
127 skip_serializing_if = "Option::is_none"
128 )]
129 pub oob_ip: Option<Option<Box<crate::models::DeviceWithConfigContextRequestPrimaryIp4>>>,
130 #[serde(
131 rename = "cluster",
132 default,
133 with = "::serde_with::rust::double_option",
134 skip_serializing_if = "Option::is_none"
135 )]
136 pub cluster: Option<Option<Box<crate::models::DeviceWithConfigContextRequestCluster>>>,
137 #[serde(
138 rename = "virtual_chassis",
139 default,
140 with = "::serde_with::rust::double_option",
141 skip_serializing_if = "Option::is_none"
142 )]
143 pub virtual_chassis:
144 Option<Option<Box<crate::models::DeviceWithConfigContextRequestVirtualChassis>>>,
145 #[serde(
146 rename = "vc_position",
147 default,
148 with = "::serde_with::rust::double_option",
149 skip_serializing_if = "Option::is_none"
150 )]
151 pub vc_position: Option<Option<i32>>,
152 #[serde(
154 rename = "vc_priority",
155 default,
156 with = "::serde_with::rust::double_option",
157 skip_serializing_if = "Option::is_none"
158 )]
159 pub vc_priority: Option<Option<i32>>,
160 #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
161 pub description: Option<String>,
162 #[serde(
163 rename = "owner",
164 default,
165 with = "::serde_with::rust::double_option",
166 skip_serializing_if = "Option::is_none"
167 )]
168 pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
169 #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
170 pub comments: Option<String>,
171 #[serde(
172 rename = "config_template",
173 default,
174 with = "::serde_with::rust::double_option",
175 skip_serializing_if = "Option::is_none"
176 )]
177 pub config_template: Option<Option<Box<crate::models::DeviceRoleRequestConfigTemplate>>>,
178 #[serde(
180 rename = "local_context_data",
181 default,
182 with = "::serde_with::rust::double_option",
183 skip_serializing_if = "Option::is_none"
184 )]
185 pub local_context_data: Option<Option<serde_json::Value>>,
186 #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
187 pub tags: Option<Vec<crate::models::NestedTagRequest>>,
188 #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
189 pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
190}
191
192impl WritableDeviceWithConfigContextRequest {
193 pub fn new(
195 device_type: crate::models::DeviceBayTemplateRequestDeviceType,
196 role: crate::models::DeviceWithConfigContextRequestRole,
197 site: crate::models::DeviceWithConfigContextRequestSite,
198 ) -> WritableDeviceWithConfigContextRequest {
199 WritableDeviceWithConfigContextRequest {
200 name: None,
201 device_type: Box::new(device_type),
202 role: Box::new(role),
203 tenant: None,
204 platform: None,
205 serial: None,
206 asset_tag: None,
207 site: Box::new(site),
208 location: None,
209 rack: None,
210 position: None,
211 face: None,
212 latitude: None,
213 longitude: None,
214 status: None,
215 airflow: None,
216 primary_ip4: None,
217 primary_ip6: None,
218 oob_ip: None,
219 cluster: None,
220 virtual_chassis: None,
221 vc_position: None,
222 vc_priority: None,
223 description: None,
224 owner: None,
225 comments: None,
226 config_template: None,
227 local_context_data: None,
228 tags: None,
229 custom_fields: None,
230 }
231 }
232}
233
234#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
236pub enum Face {
237 #[serde(rename = "front")]
238 Front,
239 #[serde(rename = "rear")]
240 Rear,
241 #[serde(rename = "")]
242 Empty,
243 #[serde(rename = "null")]
244 Null,
245}
246
247impl Default for Face {
248 fn default() -> Face {
249 Self::Front
250 }
251}
252#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
254pub enum Status {
255 #[serde(rename = "offline")]
256 Offline,
257 #[serde(rename = "active")]
258 Active,
259 #[serde(rename = "planned")]
260 Planned,
261 #[serde(rename = "staged")]
262 Staged,
263 #[serde(rename = "failed")]
264 Failed,
265 #[serde(rename = "inventory")]
266 Inventory,
267 #[serde(rename = "decommissioning")]
268 Decommissioning,
269}
270
271impl Default for Status {
272 fn default() -> Status {
273 Self::Offline
274 }
275}
276#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
278pub enum Airflow {
279 #[serde(rename = "front-to-rear")]
280 FrontToRear,
281 #[serde(rename = "rear-to-front")]
282 RearToFront,
283 #[serde(rename = "left-to-right")]
284 LeftToRight,
285 #[serde(rename = "right-to-left")]
286 RightToLeft,
287 #[serde(rename = "side-to-rear")]
288 SideToRear,
289 #[serde(rename = "rear-to-side")]
290 RearToSide,
291 #[serde(rename = "bottom-to-top")]
292 BottomToTop,
293 #[serde(rename = "top-to-bottom")]
294 TopToBottom,
295 #[serde(rename = "passive")]
296 Passive,
297 #[serde(rename = "mixed")]
298 Mixed,
299 #[serde(rename = "")]
300 Empty,
301 #[serde(rename = "null")]
302 Null,
303}
304
305impl Default for Airflow {
306 fn default() -> Airflow {
307 Self::FrontToRear
308 }
309}