Skip to main content

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