Skip to main content

netbox_openapi/models/
patched_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/// PatchedBulkDeviceWithConfigContextRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedBulkDeviceWithConfigContextRequest {
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", skip_serializing_if = "Option::is_none")]
25    pub device_type: Option<Box<crate::models::BulkDeviceBayTemplateRequestDeviceType>>,
26    #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
27    pub role: Option<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", skip_serializing_if = "Option::is_none")]
54    pub site: Option<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 PatchedBulkDeviceWithConfigContextRequest {
187    /// Base serializer class for models inheriting from PrimaryModel.
188    pub fn new(id: i32) -> PatchedBulkDeviceWithConfigContextRequest {
189        PatchedBulkDeviceWithConfigContextRequest {
190            id,
191            name: None,
192            device_type: None,
193            role: None,
194            tenant: None,
195            platform: None,
196            serial: None,
197            asset_tag: None,
198            site: None,
199            location: None,
200            rack: None,
201            position: None,
202            face: None,
203            latitude: None,
204            longitude: None,
205            status: None,
206            airflow: None,
207            primary_ip4: None,
208            primary_ip6: None,
209            oob_ip: None,
210            cluster: None,
211            virtual_chassis: None,
212            vc_position: None,
213            vc_priority: None,
214            description: None,
215            owner: None,
216            comments: None,
217            config_template: None,
218            local_context_data: None,
219            tags: None,
220            custom_fields: None,
221        }
222    }
223}
224
225/// * `front` - Front * `rear` - Rear
226#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
227pub enum Face {
228    #[serde(rename = "front")]
229    Front,
230    #[serde(rename = "rear")]
231    Rear,
232    #[serde(rename = "")]
233    Empty,
234}
235
236impl Default for Face {
237    fn default() -> Face {
238        Self::Front
239    }
240}
241/// * `offline` - Offline * `active` - Active * `planned` - Planned * `staged` - Staged * `failed` - Failed * `inventory` - Inventory * `decommissioning` - Decommissioning
242#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
243pub enum Status {
244    #[serde(rename = "offline")]
245    Offline,
246    #[serde(rename = "active")]
247    Active,
248    #[serde(rename = "planned")]
249    Planned,
250    #[serde(rename = "staged")]
251    Staged,
252    #[serde(rename = "failed")]
253    Failed,
254    #[serde(rename = "inventory")]
255    Inventory,
256    #[serde(rename = "decommissioning")]
257    Decommissioning,
258}
259
260impl Default for Status {
261    fn default() -> Status {
262        Self::Offline
263    }
264}
265/// * `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
266#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
267pub enum Airflow {
268    #[serde(rename = "front-to-rear")]
269    FrontToRear,
270    #[serde(rename = "rear-to-front")]
271    RearToFront,
272    #[serde(rename = "left-to-right")]
273    LeftToRight,
274    #[serde(rename = "right-to-left")]
275    RightToLeft,
276    #[serde(rename = "side-to-rear")]
277    SideToRear,
278    #[serde(rename = "rear-to-side")]
279    RearToSide,
280    #[serde(rename = "bottom-to-top")]
281    BottomToTop,
282    #[serde(rename = "top-to-bottom")]
283    TopToBottom,
284    #[serde(rename = "passive")]
285    Passive,
286    #[serde(rename = "mixed")]
287    Mixed,
288    #[serde(rename = "")]
289    Empty,
290}
291
292impl Default for Airflow {
293    fn default() -> Airflow {
294        Self::FrontToRear
295    }
296}