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