Skip to main content

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