1#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
12pub struct DcimRacksCreateRequest {
13 #[serde(rename = "name")]
14 pub name: String,
15 #[serde(
16 rename = "facility_id",
17 default,
18 with = "::serde_with::rust::double_option",
19 skip_serializing_if = "Option::is_none"
20 )]
21 pub facility_id: Option<Option<String>>,
22 #[serde(rename = "site")]
23 pub site: Box<crate::models::DeviceWithConfigContextRequestSite>,
24 #[serde(
25 rename = "location",
26 default,
27 with = "::serde_with::rust::double_option",
28 skip_serializing_if = "Option::is_none"
29 )]
30 pub location: Option<Option<Box<crate::models::DeviceWithConfigContextRequestLocation>>>,
31 #[serde(
32 rename = "group",
33 default,
34 with = "::serde_with::rust::double_option",
35 skip_serializing_if = "Option::is_none"
36 )]
37 pub group: Option<Option<Box<crate::models::PatchedWritableRackRequestGroup>>>,
38 #[serde(
39 rename = "tenant",
40 default,
41 with = "::serde_with::rust::double_option",
42 skip_serializing_if = "Option::is_none"
43 )]
44 pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
45 #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
47 pub status: Option<Status>,
48 #[serde(
49 rename = "role",
50 default,
51 with = "::serde_with::rust::double_option",
52 skip_serializing_if = "Option::is_none"
53 )]
54 pub role: Option<Option<Box<crate::models::PatchedWritableRackRequestRole>>>,
55 #[serde(rename = "serial", skip_serializing_if = "Option::is_none")]
56 pub serial: Option<String>,
57 #[serde(
59 rename = "asset_tag",
60 default,
61 with = "::serde_with::rust::double_option",
62 skip_serializing_if = "Option::is_none"
63 )]
64 pub asset_tag: Option<Option<String>>,
65 #[serde(
66 rename = "rack_type",
67 default,
68 with = "::serde_with::rust::double_option",
69 skip_serializing_if = "Option::is_none"
70 )]
71 pub rack_type: Option<Option<Box<crate::models::PatchedWritableRackRequestRackType>>>,
72 #[serde(
74 rename = "form_factor",
75 default,
76 with = "::serde_with::rust::double_option",
77 skip_serializing_if = "Option::is_none"
78 )]
79 pub form_factor: Option<Option<FormFactor>>,
80 #[serde(rename = "width", skip_serializing_if = "Option::is_none")]
82 pub width: Option<i32>,
83 #[serde(rename = "u_height", skip_serializing_if = "Option::is_none")]
85 pub u_height: Option<i32>,
86 #[serde(rename = "starting_unit", skip_serializing_if = "Option::is_none")]
88 pub starting_unit: Option<i32>,
89 #[serde(
90 rename = "weight",
91 default,
92 with = "::serde_with::rust::double_option",
93 skip_serializing_if = "Option::is_none"
94 )]
95 pub weight: Option<Option<f64>>,
96 #[serde(
98 rename = "max_weight",
99 default,
100 with = "::serde_with::rust::double_option",
101 skip_serializing_if = "Option::is_none"
102 )]
103 pub max_weight: Option<Option<i32>>,
104 #[serde(
106 rename = "weight_unit",
107 default,
108 with = "::serde_with::rust::double_option",
109 skip_serializing_if = "Option::is_none"
110 )]
111 pub weight_unit: Option<Option<WeightUnit>>,
112 #[serde(rename = "desc_units", skip_serializing_if = "Option::is_none")]
114 pub desc_units: Option<bool>,
115 #[serde(
117 rename = "outer_width",
118 default,
119 with = "::serde_with::rust::double_option",
120 skip_serializing_if = "Option::is_none"
121 )]
122 pub outer_width: Option<Option<i32>>,
123 #[serde(
125 rename = "outer_height",
126 default,
127 with = "::serde_with::rust::double_option",
128 skip_serializing_if = "Option::is_none"
129 )]
130 pub outer_height: Option<Option<i32>>,
131 #[serde(
133 rename = "outer_depth",
134 default,
135 with = "::serde_with::rust::double_option",
136 skip_serializing_if = "Option::is_none"
137 )]
138 pub outer_depth: Option<Option<i32>>,
139 #[serde(
141 rename = "outer_unit",
142 default,
143 with = "::serde_with::rust::double_option",
144 skip_serializing_if = "Option::is_none"
145 )]
146 pub outer_unit: Option<Option<OuterUnit>>,
147 #[serde(
149 rename = "mounting_depth",
150 default,
151 with = "::serde_with::rust::double_option",
152 skip_serializing_if = "Option::is_none"
153 )]
154 pub mounting_depth: Option<Option<i32>>,
155 #[serde(
157 rename = "airflow",
158 default,
159 with = "::serde_with::rust::double_option",
160 skip_serializing_if = "Option::is_none"
161 )]
162 pub airflow: Option<Option<Airflow>>,
163 #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
164 pub description: Option<String>,
165 #[serde(
166 rename = "owner",
167 default,
168 with = "::serde_with::rust::double_option",
169 skip_serializing_if = "Option::is_none"
170 )]
171 pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
172 #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
173 pub comments: Option<String>,
174 #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
175 pub tags: Option<Vec<crate::models::NestedTagRequest>>,
176 #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
177 pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
178}
179
180impl DcimRacksCreateRequest {
181 pub fn new(
182 name: String,
183 site: crate::models::DeviceWithConfigContextRequestSite,
184 ) -> DcimRacksCreateRequest {
185 DcimRacksCreateRequest {
186 name,
187 facility_id: None,
188 site: Box::new(site),
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}