1#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct RackRequest {
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(rename = "airflow", skip_serializing_if = "Option::is_none")]
159 pub airflow: Option<Airflow>,
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(rename = "tags", skip_serializing_if = "Option::is_none")]
172 pub tags: Option<Vec<crate::models::NestedTagRequest>>,
173 #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
174 pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
175}
176
177impl RackRequest {
178 pub fn new(
180 name: String,
181 site: crate::models::DeviceWithConfigContextRequestSite,
182 ) -> RackRequest {
183 RackRequest {
184 name,
185 facility_id: None,
186 site: Box::new(site),
187 location: None,
188 group: None,
189 tenant: None,
190 status: None,
191 role: None,
192 serial: None,
193 asset_tag: None,
194 rack_type: None,
195 form_factor: None,
196 width: None,
197 u_height: None,
198 starting_unit: None,
199 weight: None,
200 max_weight: None,
201 weight_unit: None,
202 desc_units: None,
203 outer_width: None,
204 outer_height: None,
205 outer_depth: None,
206 outer_unit: None,
207 mounting_depth: None,
208 airflow: None,
209 description: None,
210 owner: None,
211 comments: None,
212 tags: None,
213 custom_fields: None,
214 }
215 }
216}
217
218#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
220pub enum Status {
221 #[serde(rename = "reserved")]
222 Reserved,
223 #[serde(rename = "available")]
224 Available,
225 #[serde(rename = "planned")]
226 Planned,
227 #[serde(rename = "active")]
228 Active,
229 #[serde(rename = "deprecated")]
230 Deprecated,
231}
232
233impl Default for Status {
234 fn default() -> Status {
235 Self::Reserved
236 }
237}
238#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
240pub enum FormFactor {
241 #[serde(rename = "2-post-frame")]
242 Variant2PostFrame,
243 #[serde(rename = "4-post-frame")]
244 Variant4PostFrame,
245 #[serde(rename = "4-post-cabinet")]
246 Variant4PostCabinet,
247 #[serde(rename = "wall-frame")]
248 WallFrame,
249 #[serde(rename = "wall-frame-vertical")]
250 WallFrameVertical,
251 #[serde(rename = "wall-cabinet")]
252 WallCabinet,
253 #[serde(rename = "wall-cabinet-vertical")]
254 WallCabinetVertical,
255 #[serde(rename = "")]
256 Empty,
257 #[serde(rename = "null")]
258 Null,
259}
260
261impl Default for FormFactor {
262 fn default() -> FormFactor {
263 Self::Variant2PostFrame
264 }
265}
266#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
268pub enum WeightUnit {
269 #[serde(rename = "kg")]
270 Kg,
271 #[serde(rename = "g")]
272 G,
273 #[serde(rename = "lb")]
274 Lb,
275 #[serde(rename = "oz")]
276 Oz,
277 #[serde(rename = "")]
278 Empty,
279 #[serde(rename = "null")]
280 Null,
281}
282
283impl Default for WeightUnit {
284 fn default() -> WeightUnit {
285 Self::Kg
286 }
287}
288#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
290pub enum OuterUnit {
291 #[serde(rename = "mm")]
292 Mm,
293 #[serde(rename = "in")]
294 In,
295 #[serde(rename = "")]
296 Empty,
297 #[serde(rename = "null")]
298 Null,
299}
300
301impl Default for OuterUnit {
302 fn default() -> OuterUnit {
303 Self::Mm
304 }
305}
306#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
308pub enum Airflow {
309 #[serde(rename = "front-to-rear")]
310 FrontToRear,
311 #[serde(rename = "rear-to-front")]
312 RearToFront,
313 #[serde(rename = "")]
314 Empty,
315}
316
317impl Default for Airflow {
318 fn default() -> Airflow {
319 Self::FrontToRear
320 }
321}