Skip to main content

netbox_openapi/models/
bulk_device_with_config_context_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/// BulkDeviceWithConfigContextRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct BulkDeviceWithConfigContextRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(
18        rename = "name",
19        default,
20        with = "::serde_with::rust::double_option",
21        skip_serializing_if = "Option::is_none"
22    )]
23    pub name: Option<Option<String>>,
24    #[serde(rename = "device_type")]
25    pub device_type: Box<crate::models::BulkDeviceBayTemplateRequestDeviceType>,
26    #[serde(rename = "role")]
27    pub role: Box<crate::models::BulkDeviceWithConfigContextRequestRole>,
28    #[serde(
29        rename = "tenant",
30        default,
31        with = "::serde_with::rust::double_option",
32        skip_serializing_if = "Option::is_none"
33    )]
34    pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
35    #[serde(
36        rename = "platform",
37        default,
38        with = "::serde_with::rust::double_option",
39        skip_serializing_if = "Option::is_none"
40    )]
41    pub platform: Option<Option<Box<crate::models::BulkDeviceTypeRequestDefaultPlatform>>>,
42    /// Chassis serial number, assigned by the manufacturer
43    #[serde(rename = "serial", skip_serializing_if = "Option::is_none")]
44    pub serial: Option<String>,
45    /// A unique tag used to identify this device
46    #[serde(
47        rename = "asset_tag",
48        default,
49        with = "::serde_with::rust::double_option",
50        skip_serializing_if = "Option::is_none"
51    )]
52    pub asset_tag: Option<Option<String>>,
53    #[serde(rename = "site")]
54    pub site: Box<crate::models::BulkDeviceWithConfigContextRequestSite>,
55    #[serde(
56        rename = "location",
57        default,
58        with = "::serde_with::rust::double_option",
59        skip_serializing_if = "Option::is_none"
60    )]
61    pub location: Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestLocation>>>,
62    #[serde(
63        rename = "rack",
64        default,
65        with = "::serde_with::rust::double_option",
66        skip_serializing_if = "Option::is_none"
67    )]
68    pub rack: Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestRack>>>,
69    #[serde(
70        rename = "position",
71        default,
72        with = "::serde_with::rust::double_option",
73        skip_serializing_if = "Option::is_none"
74    )]
75    pub position: Option<Option<f64>>,
76    /// * `front` - Front * `rear` - Rear
77    #[serde(rename = "face", skip_serializing_if = "Option::is_none")]
78    pub face: Option<Face>,
79    /// GPS coordinate in decimal format (xx.yyyyyy)
80    #[serde(
81        rename = "latitude",
82        default,
83        with = "::serde_with::rust::double_option",
84        skip_serializing_if = "Option::is_none"
85    )]
86    pub latitude: Option<Option<f64>>,
87    /// GPS coordinate in decimal format (xx.yyyyyy)
88    #[serde(
89        rename = "longitude",
90        default,
91        with = "::serde_with::rust::double_option",
92        skip_serializing_if = "Option::is_none"
93    )]
94    pub longitude: Option<Option<f64>>,
95    /// * `offline` - Offline * `active` - Active * `planned` - Planned * `staged` - Staged * `failed` - Failed * `inventory` - Inventory * `decommissioning` - Decommissioning
96    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
97    pub status: Option<Status>,
98    /// * `front-to-rear` - Front to rear * `rear-to-front` - Rear to front * `left-to-right` - Left to right * `right-to-left` - Right to left * `side-to-rear` - Side to rear * `rear-to-side` - Rear to side * `bottom-to-top` - Bottom to top * `top-to-bottom` - Top to bottom * `passive` - Passive * `mixed` - Mixed
99    #[serde(rename = "airflow", skip_serializing_if = "Option::is_none")]
100    pub airflow: Option<Airflow>,
101    #[serde(
102        rename = "primary_ip4",
103        default,
104        with = "::serde_with::rust::double_option",
105        skip_serializing_if = "Option::is_none"
106    )]
107    pub primary_ip4:
108        Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestPrimaryIp4>>>,
109    #[serde(
110        rename = "primary_ip6",
111        default,
112        with = "::serde_with::rust::double_option",
113        skip_serializing_if = "Option::is_none"
114    )]
115    pub primary_ip6:
116        Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestPrimaryIp4>>>,
117    #[serde(
118        rename = "oob_ip",
119        default,
120        with = "::serde_with::rust::double_option",
121        skip_serializing_if = "Option::is_none"
122    )]
123    pub oob_ip: Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestPrimaryIp4>>>,
124    #[serde(
125        rename = "cluster",
126        default,
127        with = "::serde_with::rust::double_option",
128        skip_serializing_if = "Option::is_none"
129    )]
130    pub cluster: Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestCluster>>>,
131    #[serde(
132        rename = "virtual_chassis",
133        default,
134        with = "::serde_with::rust::double_option",
135        skip_serializing_if = "Option::is_none"
136    )]
137    pub virtual_chassis:
138        Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestVirtualChassis>>>,
139    #[serde(
140        rename = "vc_position",
141        default,
142        with = "::serde_with::rust::double_option",
143        skip_serializing_if = "Option::is_none"
144    )]
145    pub vc_position: Option<Option<i32>>,
146    /// Virtual chassis master election priority
147    #[serde(
148        rename = "vc_priority",
149        default,
150        with = "::serde_with::rust::double_option",
151        skip_serializing_if = "Option::is_none"
152    )]
153    pub vc_priority: Option<Option<i32>>,
154    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
155    pub description: Option<String>,
156    #[serde(
157        rename = "owner",
158        default,
159        with = "::serde_with::rust::double_option",
160        skip_serializing_if = "Option::is_none"
161    )]
162    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
163    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
164    pub comments: Option<String>,
165    #[serde(
166        rename = "config_template",
167        default,
168        with = "::serde_with::rust::double_option",
169        skip_serializing_if = "Option::is_none"
170    )]
171    pub config_template: Option<Option<Box<crate::models::BulkDeviceRoleRequestConfigTemplate>>>,
172    /// Local config context data takes precedence over source contexts in the final rendered config context
173    #[serde(
174        rename = "local_context_data",
175        default,
176        with = "::serde_with::rust::double_option",
177        skip_serializing_if = "Option::is_none"
178    )]
179    pub local_context_data: Option<Option<serde_json::Value>>,
180    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
181    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
182    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
183    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
184}
185
186impl BulkDeviceWithConfigContextRequest {
187    /// Base serializer class for models inheriting from PrimaryModel.
188    pub fn new(
189        id: i32,
190        device_type: crate::models::BulkDeviceBayTemplateRequestDeviceType,
191        role: crate::models::BulkDeviceWithConfigContextRequestRole,
192        site: crate::models::BulkDeviceWithConfigContextRequestSite,
193    ) -> BulkDeviceWithConfigContextRequest {
194        BulkDeviceWithConfigContextRequest {
195            id,
196            name: None,
197            device_type: Box::new(device_type),
198            role: Box::new(role),
199            tenant: None,
200            platform: None,
201            serial: None,
202            asset_tag: None,
203            site: Box::new(site),
204            location: None,
205            rack: None,
206            position: None,
207            face: None,
208            latitude: None,
209            longitude: None,
210            status: None,
211            airflow: None,
212            primary_ip4: None,
213            primary_ip6: None,
214            oob_ip: None,
215            cluster: None,
216            virtual_chassis: None,
217            vc_position: None,
218            vc_priority: None,
219            description: None,
220            owner: None,
221            comments: None,
222            config_template: None,
223            local_context_data: None,
224            tags: None,
225            custom_fields: None,
226        }
227    }
228}
229
230/// * `front` - Front * `rear` - Rear
231#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
232pub enum Face {
233    #[serde(rename = "front")]
234    Front,
235    #[serde(rename = "rear")]
236    Rear,
237    #[serde(rename = "")]
238    Empty,
239}
240
241impl Default for Face {
242    fn default() -> Face {
243        Self::Front
244    }
245}
246/// * `offline` - Offline * `active` - Active * `planned` - Planned * `staged` - Staged * `failed` - Failed * `inventory` - Inventory * `decommissioning` - Decommissioning
247#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
248pub enum Status {
249    #[serde(rename = "offline")]
250    Offline,
251    #[serde(rename = "active")]
252    Active,
253    #[serde(rename = "planned")]
254    Planned,
255    #[serde(rename = "staged")]
256    Staged,
257    #[serde(rename = "failed")]
258    Failed,
259    #[serde(rename = "inventory")]
260    Inventory,
261    #[serde(rename = "decommissioning")]
262    Decommissioning,
263}
264
265impl Default for Status {
266    fn default() -> Status {
267        Self::Offline
268    }
269}
270/// * `front-to-rear` - Front to rear * `rear-to-front` - Rear to front * `left-to-right` - Left to right * `right-to-left` - Right to left * `side-to-rear` - Side to rear * `rear-to-side` - Rear to side * `bottom-to-top` - Bottom to top * `top-to-bottom` - Top to bottom * `passive` - Passive * `mixed` - Mixed
271#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
272pub enum Airflow {
273    #[serde(rename = "front-to-rear")]
274    FrontToRear,
275    #[serde(rename = "rear-to-front")]
276    RearToFront,
277    #[serde(rename = "left-to-right")]
278    LeftToRight,
279    #[serde(rename = "right-to-left")]
280    RightToLeft,
281    #[serde(rename = "side-to-rear")]
282    SideToRear,
283    #[serde(rename = "rear-to-side")]
284    RearToSide,
285    #[serde(rename = "bottom-to-top")]
286    BottomToTop,
287    #[serde(rename = "top-to-bottom")]
288    TopToBottom,
289    #[serde(rename = "passive")]
290    Passive,
291    #[serde(rename = "mixed")]
292    Mixed,
293    #[serde(rename = "")]
294    Empty,
295}
296
297impl Default for Airflow {
298    fn default() -> Airflow {
299        Self::FrontToRear
300    }
301}