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