Skip to main content

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