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