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::BulkDeviceBayTemplateRequestDeviceType>>,
24 #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
25 pub role: Option<Box<crate::models::BulkDeviceWithConfigContextRequestRole>>,
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::BulkDeviceTypeRequestDefaultPlatform>>>,
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::BulkDeviceWithConfigContextRequestSite>>,
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::BulkDeviceWithConfigContextRequestLocation>>>,
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::BulkDeviceWithConfigContextRequestRack>>>,
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:
116 Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestPrimaryIp4>>>,
117 #[serde(
118 rename = "primary_ip6",
119 default,
120 with = "::serde_with::rust::double_option",
121 skip_serializing_if = "Option::is_none"
122 )]
123 pub primary_ip6:
124 Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestPrimaryIp4>>>,
125 #[serde(
126 rename = "oob_ip",
127 default,
128 with = "::serde_with::rust::double_option",
129 skip_serializing_if = "Option::is_none"
130 )]
131 pub oob_ip: Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestPrimaryIp4>>>,
132 #[serde(
133 rename = "cluster",
134 default,
135 with = "::serde_with::rust::double_option",
136 skip_serializing_if = "Option::is_none"
137 )]
138 pub cluster: Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestCluster>>>,
139 #[serde(
140 rename = "virtual_chassis",
141 default,
142 with = "::serde_with::rust::double_option",
143 skip_serializing_if = "Option::is_none"
144 )]
145 pub virtual_chassis:
146 Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestVirtualChassis>>>,
147 #[serde(
148 rename = "vc_position",
149 default,
150 with = "::serde_with::rust::double_option",
151 skip_serializing_if = "Option::is_none"
152 )]
153 pub vc_position: Option<Option<i32>>,
154 #[serde(
156 rename = "vc_priority",
157 default,
158 with = "::serde_with::rust::double_option",
159 skip_serializing_if = "Option::is_none"
160 )]
161 pub vc_priority: Option<Option<i32>>,
162 #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
163 pub description: Option<String>,
164 #[serde(
165 rename = "owner",
166 default,
167 with = "::serde_with::rust::double_option",
168 skip_serializing_if = "Option::is_none"
169 )]
170 pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
171 #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
172 pub comments: Option<String>,
173 #[serde(
174 rename = "config_template",
175 default,
176 with = "::serde_with::rust::double_option",
177 skip_serializing_if = "Option::is_none"
178 )]
179 pub config_template: Option<Option<Box<crate::models::BulkDeviceRoleRequestConfigTemplate>>>,
180 #[serde(
182 rename = "local_context_data",
183 default,
184 with = "::serde_with::rust::double_option",
185 skip_serializing_if = "Option::is_none"
186 )]
187 pub local_context_data: Option<Option<serde_json::Value>>,
188 #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
189 pub tags: Option<Vec<crate::models::NestedTagRequest>>,
190 #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
191 pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
192}
193
194impl PatchedWritableDeviceWithConfigContextRequest {
195 pub fn new() -> PatchedWritableDeviceWithConfigContextRequest {
197 PatchedWritableDeviceWithConfigContextRequest {
198 name: None,
199 device_type: None,
200 role: None,
201 tenant: None,
202 platform: None,
203 serial: None,
204 asset_tag: None,
205 site: None,
206 location: None,
207 rack: None,
208 position: None,
209 face: None,
210 latitude: None,
211 longitude: None,
212 status: None,
213 airflow: None,
214 primary_ip4: None,
215 primary_ip6: None,
216 oob_ip: None,
217 cluster: None,
218 virtual_chassis: None,
219 vc_position: None,
220 vc_priority: None,
221 description: None,
222 owner: None,
223 comments: None,
224 config_template: None,
225 local_context_data: None,
226 tags: None,
227 custom_fields: None,
228 }
229 }
230}
231
232#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
234pub enum Face {
235 #[serde(rename = "front")]
236 Front,
237 #[serde(rename = "rear")]
238 Rear,
239 #[serde(rename = "")]
240 Empty,
241 #[serde(rename = "null")]
242 Null,
243}
244
245impl Default for Face {
246 fn default() -> Face {
247 Self::Front
248 }
249}
250#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
252pub enum Status {
253 #[serde(rename = "offline")]
254 Offline,
255 #[serde(rename = "active")]
256 Active,
257 #[serde(rename = "planned")]
258 Planned,
259 #[serde(rename = "staged")]
260 Staged,
261 #[serde(rename = "failed")]
262 Failed,
263 #[serde(rename = "inventory")]
264 Inventory,
265 #[serde(rename = "decommissioning")]
266 Decommissioning,
267}
268
269impl Default for Status {
270 fn default() -> Status {
271 Self::Offline
272 }
273}
274#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
276pub enum Airflow {
277 #[serde(rename = "front-to-rear")]
278 FrontToRear,
279 #[serde(rename = "rear-to-front")]
280 RearToFront,
281 #[serde(rename = "left-to-right")]
282 LeftToRight,
283 #[serde(rename = "right-to-left")]
284 RightToLeft,
285 #[serde(rename = "side-to-rear")]
286 SideToRear,
287 #[serde(rename = "rear-to-side")]
288 RearToSide,
289 #[serde(rename = "bottom-to-top")]
290 BottomToTop,
291 #[serde(rename = "top-to-bottom")]
292 TopToBottom,
293 #[serde(rename = "passive")]
294 Passive,
295 #[serde(rename = "mixed")]
296 Mixed,
297 #[serde(rename = "")]
298 Empty,
299 #[serde(rename = "null")]
300 Null,
301}
302
303impl Default for Airflow {
304 fn default() -> Airflow {
305 Self::FrontToRear
306 }
307}