1#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct WritableRackRequest {
15 #[serde(rename = "name")]
16 pub name: String,
17 #[serde(
18 rename = "facility_id",
19 default,
20 with = "::serde_with::rust::double_option",
21 skip_serializing_if = "Option::is_none"
22 )]
23 pub facility_id: Option<Option<String>>,
24 #[serde(rename = "site")]
25 pub site: Box<crate::models::DeviceWithConfigContextRequestSite>,
26 #[serde(
27 rename = "location",
28 default,
29 with = "::serde_with::rust::double_option",
30 skip_serializing_if = "Option::is_none"
31 )]
32 pub location: Option<Option<Box<crate::models::DeviceWithConfigContextRequestLocation>>>,
33 #[serde(
34 rename = "group",
35 default,
36 with = "::serde_with::rust::double_option",
37 skip_serializing_if = "Option::is_none"
38 )]
39 pub group: Option<Option<Box<crate::models::PatchedWritableRackRequestGroup>>>,
40 #[serde(
41 rename = "tenant",
42 default,
43 with = "::serde_with::rust::double_option",
44 skip_serializing_if = "Option::is_none"
45 )]
46 pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
47 #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
49 pub status: Option<Status>,
50 #[serde(
51 rename = "role",
52 default,
53 with = "::serde_with::rust::double_option",
54 skip_serializing_if = "Option::is_none"
55 )]
56 pub role: Option<Option<Box<crate::models::PatchedWritableRackRequestRole>>>,
57 #[serde(rename = "serial", skip_serializing_if = "Option::is_none")]
58 pub serial: Option<String>,
59 #[serde(
61 rename = "asset_tag",
62 default,
63 with = "::serde_with::rust::double_option",
64 skip_serializing_if = "Option::is_none"
65 )]
66 pub asset_tag: Option<Option<String>>,
67 #[serde(
68 rename = "rack_type",
69 default,
70 with = "::serde_with::rust::double_option",
71 skip_serializing_if = "Option::is_none"
72 )]
73 pub rack_type: Option<Option<Box<crate::models::PatchedWritableRackRequestRackType>>>,
74 #[serde(
76 rename = "form_factor",
77 default,
78 with = "::serde_with::rust::double_option",
79 skip_serializing_if = "Option::is_none"
80 )]
81 pub form_factor: Option<Option<FormFactor>>,
82 #[serde(rename = "width", skip_serializing_if = "Option::is_none")]
84 pub width: Option<i32>,
85 #[serde(rename = "u_height", skip_serializing_if = "Option::is_none")]
87 pub u_height: Option<i32>,
88 #[serde(rename = "starting_unit", skip_serializing_if = "Option::is_none")]
90 pub starting_unit: Option<i32>,
91 #[serde(
92 rename = "weight",
93 default,
94 with = "::serde_with::rust::double_option",
95 skip_serializing_if = "Option::is_none"
96 )]
97 pub weight: Option<Option<f64>>,
98 #[serde(
100 rename = "max_weight",
101 default,
102 with = "::serde_with::rust::double_option",
103 skip_serializing_if = "Option::is_none"
104 )]
105 pub max_weight: Option<Option<i32>>,
106 #[serde(
108 rename = "weight_unit",
109 default,
110 with = "::serde_with::rust::double_option",
111 skip_serializing_if = "Option::is_none"
112 )]
113 pub weight_unit: Option<Option<WeightUnit>>,
114 #[serde(rename = "desc_units", skip_serializing_if = "Option::is_none")]
116 pub desc_units: Option<bool>,
117 #[serde(
119 rename = "outer_width",
120 default,
121 with = "::serde_with::rust::double_option",
122 skip_serializing_if = "Option::is_none"
123 )]
124 pub outer_width: Option<Option<i32>>,
125 #[serde(
127 rename = "outer_height",
128 default,
129 with = "::serde_with::rust::double_option",
130 skip_serializing_if = "Option::is_none"
131 )]
132 pub outer_height: Option<Option<i32>>,
133 #[serde(
135 rename = "outer_depth",
136 default,
137 with = "::serde_with::rust::double_option",
138 skip_serializing_if = "Option::is_none"
139 )]
140 pub outer_depth: Option<Option<i32>>,
141 #[serde(
143 rename = "outer_unit",
144 default,
145 with = "::serde_with::rust::double_option",
146 skip_serializing_if = "Option::is_none"
147 )]
148 pub outer_unit: Option<Option<OuterUnit>>,
149 #[serde(
151 rename = "mounting_depth",
152 default,
153 with = "::serde_with::rust::double_option",
154 skip_serializing_if = "Option::is_none"
155 )]
156 pub mounting_depth: Option<Option<i32>>,
157 #[serde(
159 rename = "airflow",
160 default,
161 with = "::serde_with::rust::double_option",
162 skip_serializing_if = "Option::is_none"
163 )]
164 pub airflow: Option<Option<Airflow>>,
165 #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
166 pub description: Option<String>,
167 #[serde(
168 rename = "owner",
169 default,
170 with = "::serde_with::rust::double_option",
171 skip_serializing_if = "Option::is_none"
172 )]
173 pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
174 #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
175 pub comments: Option<String>,
176 #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
177 pub tags: Option<Vec<crate::models::NestedTagRequest>>,
178 #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
179 pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
180}
181
182impl WritableRackRequest {
183 pub fn new(
185 name: String,
186 site: crate::models::DeviceWithConfigContextRequestSite,
187 ) -> WritableRackRequest {
188 WritableRackRequest {
189 name,
190 facility_id: None,
191 site: Box::new(site),
192 location: None,
193 group: None,
194 tenant: None,
195 status: None,
196 role: None,
197 serial: None,
198 asset_tag: None,
199 rack_type: None,
200 form_factor: None,
201 width: None,
202 u_height: None,
203 starting_unit: None,
204 weight: None,
205 max_weight: None,
206 weight_unit: None,
207 desc_units: None,
208 outer_width: None,
209 outer_height: None,
210 outer_depth: None,
211 outer_unit: None,
212 mounting_depth: None,
213 airflow: None,
214 description: None,
215 owner: None,
216 comments: None,
217 tags: None,
218 custom_fields: None,
219 }
220 }
221}
222
223#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
225pub enum Status {
226 #[serde(rename = "reserved")]
227 Reserved,
228 #[serde(rename = "available")]
229 Available,
230 #[serde(rename = "planned")]
231 Planned,
232 #[serde(rename = "active")]
233 Active,
234 #[serde(rename = "deprecated")]
235 Deprecated,
236}
237
238impl Default for Status {
239 fn default() -> Status {
240 Self::Reserved
241 }
242}
243#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
245pub enum FormFactor {
246 #[serde(rename = "2-post-frame")]
247 Variant2PostFrame,
248 #[serde(rename = "4-post-frame")]
249 Variant4PostFrame,
250 #[serde(rename = "4-post-cabinet")]
251 Variant4PostCabinet,
252 #[serde(rename = "wall-frame")]
253 WallFrame,
254 #[serde(rename = "wall-frame-vertical")]
255 WallFrameVertical,
256 #[serde(rename = "wall-cabinet")]
257 WallCabinet,
258 #[serde(rename = "wall-cabinet-vertical")]
259 WallCabinetVertical,
260 #[serde(rename = "")]
261 Empty,
262 #[serde(rename = "null")]
263 Null,
264}
265
266impl Default for FormFactor {
267 fn default() -> FormFactor {
268 Self::Variant2PostFrame
269 }
270}
271#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
273pub enum WeightUnit {
274 #[serde(rename = "kg")]
275 Kg,
276 #[serde(rename = "g")]
277 G,
278 #[serde(rename = "lb")]
279 Lb,
280 #[serde(rename = "oz")]
281 Oz,
282 #[serde(rename = "")]
283 Empty,
284 #[serde(rename = "null")]
285 Null,
286}
287
288impl Default for WeightUnit {
289 fn default() -> WeightUnit {
290 Self::Kg
291 }
292}
293#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
295pub enum OuterUnit {
296 #[serde(rename = "mm")]
297 Mm,
298 #[serde(rename = "in")]
299 In,
300 #[serde(rename = "")]
301 Empty,
302 #[serde(rename = "null")]
303 Null,
304}
305
306impl Default for OuterUnit {
307 fn default() -> OuterUnit {
308 Self::Mm
309 }
310}
311#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
313pub enum Airflow {
314 #[serde(rename = "front-to-rear")]
315 FrontToRear,
316 #[serde(rename = "rear-to-front")]
317 RearToFront,
318 #[serde(rename = "")]
319 Empty,
320 #[serde(rename = "null")]
321 Null,
322}
323
324impl Default for Airflow {
325 fn default() -> Airflow {
326 Self::FrontToRear
327 }
328}