Skip to main content

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