Skip to main content

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