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.6.2 (4.6)
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 = "group",
35        default,
36        with = "::serde_with::rust::double_option",
37        skip_serializing_if = "Option::is_none"
38    )]
39    pub group: Option<Option<Box<crate::models::PatchedWritableRackRequestGroup>>>,
40    #[serde(
41        rename = "tenant",
42        default,
43        with = "::serde_with::rust::double_option",
44        skip_serializing_if = "Option::is_none"
45    )]
46    pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
47    /// * `reserved` - Reserved * `available` - Available * `planned` - Planned * `active` - Active * `deprecated` - Deprecated
48    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
49    pub status: Option<Status>,
50    #[serde(
51        rename = "role",
52        default,
53        with = "::serde_with::rust::double_option",
54        skip_serializing_if = "Option::is_none"
55    )]
56    pub role: Option<Option<Box<crate::models::PatchedWritableRackRequestRole>>>,
57    #[serde(rename = "serial", skip_serializing_if = "Option::is_none")]
58    pub serial: Option<String>,
59    /// A unique tag used to identify this rack
60    #[serde(
61        rename = "asset_tag",
62        default,
63        with = "::serde_with::rust::double_option",
64        skip_serializing_if = "Option::is_none"
65    )]
66    pub asset_tag: Option<Option<String>>,
67    #[serde(
68        rename = "rack_type",
69        default,
70        with = "::serde_with::rust::double_option",
71        skip_serializing_if = "Option::is_none"
72    )]
73    pub rack_type: Option<Option<Box<crate::models::PatchedWritableRackRequestRackType>>>,
74    /// * `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)
75    #[serde(
76        rename = "form_factor",
77        default,
78        with = "::serde_with::rust::double_option",
79        skip_serializing_if = "Option::is_none"
80    )]
81    pub form_factor: Option<Option<FormFactor>>,
82    /// Rail-to-rail width  * `10` - 10 inches * `19` - 19 inches * `21` - 21 inches * `23` - 23 inches
83    #[serde(rename = "width", skip_serializing_if = "Option::is_none")]
84    pub width: Option<i32>,
85    /// Height in rack units
86    #[serde(rename = "u_height", skip_serializing_if = "Option::is_none")]
87    pub u_height: Option<i32>,
88    /// Starting unit for rack
89    #[serde(rename = "starting_unit", skip_serializing_if = "Option::is_none")]
90    pub starting_unit: Option<i32>,
91    #[serde(
92        rename = "weight",
93        default,
94        with = "::serde_with::rust::double_option",
95        skip_serializing_if = "Option::is_none"
96    )]
97    pub weight: Option<Option<f64>>,
98    /// Maximum load capacity for the rack
99    #[serde(
100        rename = "max_weight",
101        default,
102        with = "::serde_with::rust::double_option",
103        skip_serializing_if = "Option::is_none"
104    )]
105    pub max_weight: Option<Option<i32>>,
106    /// * `kg` - Kilograms * `g` - Grams * `lb` - Pounds * `oz` - Ounces
107    #[serde(
108        rename = "weight_unit",
109        default,
110        with = "::serde_with::rust::double_option",
111        skip_serializing_if = "Option::is_none"
112    )]
113    pub weight_unit: Option<Option<WeightUnit>>,
114    /// Units are numbered top-to-bottom
115    #[serde(rename = "desc_units", skip_serializing_if = "Option::is_none")]
116    pub desc_units: Option<bool>,
117    /// Outer dimension of rack (width)
118    #[serde(
119        rename = "outer_width",
120        default,
121        with = "::serde_with::rust::double_option",
122        skip_serializing_if = "Option::is_none"
123    )]
124    pub outer_width: Option<Option<i32>>,
125    /// Outer dimension of rack (height)
126    #[serde(
127        rename = "outer_height",
128        default,
129        with = "::serde_with::rust::double_option",
130        skip_serializing_if = "Option::is_none"
131    )]
132    pub outer_height: Option<Option<i32>>,
133    /// Outer dimension of rack (depth)
134    #[serde(
135        rename = "outer_depth",
136        default,
137        with = "::serde_with::rust::double_option",
138        skip_serializing_if = "Option::is_none"
139    )]
140    pub outer_depth: Option<Option<i32>>,
141    /// * `mm` - Millimeters * `in` - Inches
142    #[serde(
143        rename = "outer_unit",
144        default,
145        with = "::serde_with::rust::double_option",
146        skip_serializing_if = "Option::is_none"
147    )]
148    pub outer_unit: Option<Option<OuterUnit>>,
149    /// Maximum depth of a mounted device, in millimeters. For four-post racks, this is the distance between the front and rear rails.
150    #[serde(
151        rename = "mounting_depth",
152        default,
153        with = "::serde_with::rust::double_option",
154        skip_serializing_if = "Option::is_none"
155    )]
156    pub mounting_depth: Option<Option<i32>>,
157    /// * `front-to-rear` - Front to rear * `rear-to-front` - Rear to front
158    #[serde(
159        rename = "airflow",
160        default,
161        with = "::serde_with::rust::double_option",
162        skip_serializing_if = "Option::is_none"
163    )]
164    pub airflow: Option<Option<Airflow>>,
165    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
166    pub description: Option<String>,
167    #[serde(
168        rename = "owner",
169        default,
170        with = "::serde_with::rust::double_option",
171        skip_serializing_if = "Option::is_none"
172    )]
173    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
174    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
175    pub comments: Option<String>,
176    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
177    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
178    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
179    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
180}
181
182impl WritableRackRequest {
183    /// Base serializer class for models inheriting from PrimaryModel.
184    pub fn new(
185        name: String,
186        site: crate::models::DeviceWithConfigContextRequestSite,
187    ) -> WritableRackRequest {
188        WritableRackRequest {
189            name,
190            facility_id: None,
191            site: Box::new(site),
192            location: None,
193            group: None,
194            tenant: None,
195            status: None,
196            role: None,
197            serial: None,
198            asset_tag: None,
199            rack_type: None,
200            form_factor: None,
201            width: None,
202            u_height: None,
203            starting_unit: None,
204            weight: None,
205            max_weight: None,
206            weight_unit: None,
207            desc_units: None,
208            outer_width: None,
209            outer_height: None,
210            outer_depth: None,
211            outer_unit: None,
212            mounting_depth: None,
213            airflow: None,
214            description: None,
215            owner: None,
216            comments: None,
217            tags: None,
218            custom_fields: None,
219        }
220    }
221}
222
223/// * `reserved` - Reserved * `available` - Available * `planned` - Planned * `active` - Active * `deprecated` - Deprecated
224#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
225pub enum Status {
226    #[serde(rename = "reserved")]
227    Reserved,
228    #[serde(rename = "available")]
229    Available,
230    #[serde(rename = "planned")]
231    Planned,
232    #[serde(rename = "active")]
233    Active,
234    #[serde(rename = "deprecated")]
235    Deprecated,
236}
237
238impl Default for Status {
239    fn default() -> Status {
240        Self::Reserved
241    }
242}
243/// * `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)
244#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
245pub enum FormFactor {
246    #[serde(rename = "2-post-frame")]
247    Variant2PostFrame,
248    #[serde(rename = "4-post-frame")]
249    Variant4PostFrame,
250    #[serde(rename = "4-post-cabinet")]
251    Variant4PostCabinet,
252    #[serde(rename = "wall-frame")]
253    WallFrame,
254    #[serde(rename = "wall-frame-vertical")]
255    WallFrameVertical,
256    #[serde(rename = "wall-cabinet")]
257    WallCabinet,
258    #[serde(rename = "wall-cabinet-vertical")]
259    WallCabinetVertical,
260    #[serde(rename = "")]
261    Empty,
262    #[serde(rename = "null")]
263    Null,
264}
265
266impl Default for FormFactor {
267    fn default() -> FormFactor {
268        Self::Variant2PostFrame
269    }
270}
271/// * `kg` - Kilograms * `g` - Grams * `lb` - Pounds * `oz` - Ounces
272#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
273pub enum WeightUnit {
274    #[serde(rename = "kg")]
275    Kg,
276    #[serde(rename = "g")]
277    G,
278    #[serde(rename = "lb")]
279    Lb,
280    #[serde(rename = "oz")]
281    Oz,
282    #[serde(rename = "")]
283    Empty,
284    #[serde(rename = "null")]
285    Null,
286}
287
288impl Default for WeightUnit {
289    fn default() -> WeightUnit {
290        Self::Kg
291    }
292}
293/// * `mm` - Millimeters * `in` - Inches
294#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
295pub enum OuterUnit {
296    #[serde(rename = "mm")]
297    Mm,
298    #[serde(rename = "in")]
299    In,
300    #[serde(rename = "")]
301    Empty,
302    #[serde(rename = "null")]
303    Null,
304}
305
306impl Default for OuterUnit {
307    fn default() -> OuterUnit {
308        Self::Mm
309    }
310}
311/// * `front-to-rear` - Front to rear * `rear-to-front` - Rear to front
312#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
313pub enum Airflow {
314    #[serde(rename = "front-to-rear")]
315    FrontToRear,
316    #[serde(rename = "rear-to-front")]
317    RearToFront,
318    #[serde(rename = "")]
319    Empty,
320    #[serde(rename = "null")]
321    Null,
322}
323
324impl Default for Airflow {
325    fn default() -> Airflow {
326        Self::FrontToRear
327    }
328}