1#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedWritableDeviceWithConfigContextRequest {
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", skip_serializing_if = "Option::is_none")]
23 pub device_type: Option<Box<crate::models::DeviceBayTemplateRequestDeviceType>>,
24 #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
25 pub role: Option<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", skip_serializing_if = "Option::is_none")]
52 pub site: Option<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(rename = "comments", skip_serializing_if = "Option::is_none")]
163 pub comments: Option<String>,
164 #[serde(
165 rename = "config_template",
166 default,
167 with = "::serde_with::rust::double_option",
168 skip_serializing_if = "Option::is_none"
169 )]
170 pub config_template: Option<Option<Box<crate::models::DeviceRoleRequestConfigTemplate>>>,
171 #[serde(
173 rename = "local_context_data",
174 default,
175 with = "::serde_with::rust::double_option",
176 skip_serializing_if = "Option::is_none"
177 )]
178 pub local_context_data: Option<Option<serde_json::Value>>,
179 #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
180 pub tags: Option<Vec<crate::models::NestedTagRequest>>,
181 #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
182 pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
183}
184
185impl PatchedWritableDeviceWithConfigContextRequest {
186 pub fn new() -> PatchedWritableDeviceWithConfigContextRequest {
188 PatchedWritableDeviceWithConfigContextRequest {
189 name: None,
190 device_type: None,
191 role: None,
192 tenant: None,
193 platform: None,
194 serial: None,
195 asset_tag: None,
196 site: None,
197 location: None,
198 rack: None,
199 position: None,
200 face: None,
201 latitude: None,
202 longitude: None,
203 status: None,
204 airflow: None,
205 primary_ip4: None,
206 primary_ip6: None,
207 oob_ip: None,
208 cluster: None,
209 virtual_chassis: None,
210 vc_position: None,
211 vc_priority: None,
212 description: None,
213 comments: None,
214 config_template: None,
215 local_context_data: None,
216 tags: None,
217 custom_fields: None,
218 }
219 }
220}
221
222#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
224pub enum Face {
225 #[serde(rename = "front")]
226 Front,
227 #[serde(rename = "rear")]
228 Rear,
229 #[serde(rename = "")]
230 Empty,
231 #[serde(rename = "null")]
232 Null,
233}
234
235impl Default for Face {
236 fn default() -> Face {
237 Self::Front
238 }
239}
240#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
242pub enum Status {
243 #[serde(rename = "offline")]
244 Offline,
245 #[serde(rename = "active")]
246 Active,
247 #[serde(rename = "planned")]
248 Planned,
249 #[serde(rename = "staged")]
250 Staged,
251 #[serde(rename = "failed")]
252 Failed,
253 #[serde(rename = "inventory")]
254 Inventory,
255 #[serde(rename = "decommissioning")]
256 Decommissioning,
257}
258
259impl Default for Status {
260 fn default() -> Status {
261 Self::Offline
262 }
263}
264#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
266pub enum Airflow {
267 #[serde(rename = "front-to-rear")]
268 FrontToRear,
269 #[serde(rename = "rear-to-front")]
270 RearToFront,
271 #[serde(rename = "left-to-right")]
272 LeftToRight,
273 #[serde(rename = "right-to-left")]
274 RightToLeft,
275 #[serde(rename = "side-to-rear")]
276 SideToRear,
277 #[serde(rename = "rear-to-side")]
278 RearToSide,
279 #[serde(rename = "bottom-to-top")]
280 BottomToTop,
281 #[serde(rename = "top-to-bottom")]
282 TopToBottom,
283 #[serde(rename = "passive")]
284 Passive,
285 #[serde(rename = "mixed")]
286 Mixed,
287 #[serde(rename = "")]
288 Empty,
289 #[serde(rename = "null")]
290 Null,
291}
292
293impl Default for Airflow {
294 fn default() -> Airflow {
295 Self::FrontToRear
296 }
297}