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