Skip to main content

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