Skip to main content

netbox_openapi/models/
rack_request.rs

1/*
2 * NetBox REST API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 4.5.9-Docker-4.0.2 (4.5)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// RackRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct RackRequest {
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    /// * `reserved` - Reserved * `available` - Available * `planned` - Planned * `active` - Active * `deprecated` - Deprecated
41    #[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    /// A unique tag used to identify this rack
53    #[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    /// * `2-post-frame` - 2-post frame * `4-post-frame` - 4-post frame * `4-post-cabinet` - 4-post cabinet * `wall-frame` - Wall-mounted frame * `wall-frame-vertical` - Wall-mounted frame (vertical) * `wall-cabinet` - Wall-mounted cabinet * `wall-cabinet-vertical` - Wall-mounted cabinet (vertical)
68    #[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    /// * `10` - 10 inches * `19` - 19 inches * `21` - 21 inches * `23` - 23 inches
76    #[serde(rename = "width", skip_serializing_if = "Option::is_none")]
77    pub width: Option<i32>,
78    /// Height in rack units
79    #[serde(rename = "u_height", skip_serializing_if = "Option::is_none")]
80    pub u_height: Option<i32>,
81    /// Starting unit for rack
82    #[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    /// Maximum load capacity for the rack
92    #[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    /// * `kg` - Kilograms * `g` - Grams * `lb` - Pounds * `oz` - Ounces
100    #[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    /// Units are numbered top-to-bottom
108    #[serde(rename = "desc_units", skip_serializing_if = "Option::is_none")]
109    pub desc_units: Option<bool>,
110    /// Outer dimension of rack (width)
111    #[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    /// Outer dimension of rack (height)
119    #[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    /// Outer dimension of rack (depth)
127    #[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    /// * `mm` - Millimeters * `in` - Inches
135    #[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    /// Maximum depth of a mounted device, in millimeters. For four-post racks, this is the distance between the front and rear rails.
143    #[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    /// * `front-to-rear` - Front to rear * `rear-to-front` - Rear to front
151    #[serde(rename = "airflow", skip_serializing_if = "Option::is_none")]
152    pub airflow: Option<Airflow>,
153    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
154    pub description: Option<String>,
155    #[serde(
156        rename = "owner",
157        default,
158        with = "::serde_with::rust::double_option",
159        skip_serializing_if = "Option::is_none"
160    )]
161    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
162    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
163    pub comments: Option<String>,
164    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
165    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
166    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
167    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
168}
169
170impl RackRequest {
171    /// Base serializer class for models inheriting from PrimaryModel.
172    pub fn new(
173        name: String,
174        site: crate::models::DeviceWithConfigContextRequestSite,
175    ) -> RackRequest {
176        RackRequest {
177            name,
178            facility_id: None,
179            site: Box::new(site),
180            location: None,
181            tenant: None,
182            status: None,
183            role: None,
184            serial: None,
185            asset_tag: None,
186            rack_type: None,
187            form_factor: None,
188            width: None,
189            u_height: None,
190            starting_unit: None,
191            weight: None,
192            max_weight: None,
193            weight_unit: None,
194            desc_units: None,
195            outer_width: None,
196            outer_height: None,
197            outer_depth: None,
198            outer_unit: None,
199            mounting_depth: None,
200            airflow: None,
201            description: None,
202            owner: None,
203            comments: None,
204            tags: None,
205            custom_fields: None,
206        }
207    }
208}
209
210/// * `reserved` - Reserved * `available` - Available * `planned` - Planned * `active` - Active * `deprecated` - Deprecated
211#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
212pub enum Status {
213    #[serde(rename = "reserved")]
214    Reserved,
215    #[serde(rename = "available")]
216    Available,
217    #[serde(rename = "planned")]
218    Planned,
219    #[serde(rename = "active")]
220    Active,
221    #[serde(rename = "deprecated")]
222    Deprecated,
223}
224
225impl Default for Status {
226    fn default() -> Status {
227        Self::Reserved
228    }
229}
230/// * `2-post-frame` - 2-post frame * `4-post-frame` - 4-post frame * `4-post-cabinet` - 4-post cabinet * `wall-frame` - Wall-mounted frame * `wall-frame-vertical` - Wall-mounted frame (vertical) * `wall-cabinet` - Wall-mounted cabinet * `wall-cabinet-vertical` - Wall-mounted cabinet (vertical)
231#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
232pub enum FormFactor {
233    #[serde(rename = "2-post-frame")]
234    Variant2PostFrame,
235    #[serde(rename = "4-post-frame")]
236    Variant4PostFrame,
237    #[serde(rename = "4-post-cabinet")]
238    Variant4PostCabinet,
239    #[serde(rename = "wall-frame")]
240    WallFrame,
241    #[serde(rename = "wall-frame-vertical")]
242    WallFrameVertical,
243    #[serde(rename = "wall-cabinet")]
244    WallCabinet,
245    #[serde(rename = "wall-cabinet-vertical")]
246    WallCabinetVertical,
247    #[serde(rename = "")]
248    Empty,
249    #[serde(rename = "null")]
250    Null,
251}
252
253impl Default for FormFactor {
254    fn default() -> FormFactor {
255        Self::Variant2PostFrame
256    }
257}
258/// * `kg` - Kilograms * `g` - Grams * `lb` - Pounds * `oz` - Ounces
259#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
260pub enum WeightUnit {
261    #[serde(rename = "kg")]
262    Kg,
263    #[serde(rename = "g")]
264    G,
265    #[serde(rename = "lb")]
266    Lb,
267    #[serde(rename = "oz")]
268    Oz,
269    #[serde(rename = "")]
270    Empty,
271    #[serde(rename = "null")]
272    Null,
273}
274
275impl Default for WeightUnit {
276    fn default() -> WeightUnit {
277        Self::Kg
278    }
279}
280/// * `mm` - Millimeters * `in` - Inches
281#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
282pub enum OuterUnit {
283    #[serde(rename = "mm")]
284    Mm,
285    #[serde(rename = "in")]
286    In,
287    #[serde(rename = "")]
288    Empty,
289    #[serde(rename = "null")]
290    Null,
291}
292
293impl Default for OuterUnit {
294    fn default() -> OuterUnit {
295        Self::Mm
296    }
297}
298/// * `front-to-rear` - Front to rear * `rear-to-front` - Rear to front
299#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
300pub enum Airflow {
301    #[serde(rename = "front-to-rear")]
302    FrontToRear,
303    #[serde(rename = "rear-to-front")]
304    RearToFront,
305    #[serde(rename = "")]
306    Empty,
307}
308
309impl Default for Airflow {
310    fn default() -> Airflow {
311        Self::FrontToRear
312    }
313}