Skip to main content

netbox_openapi/models/
interface.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.5.9-Docker-4.0.2 (4.5)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// Interface : Adds an `owner` field for models which have a ForeignKey to users.Owner.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct Interface {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<i32>,
17    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
18    pub url: Option<String>,
19    #[serde(rename = "display_url", skip_serializing_if = "Option::is_none")]
20    pub display_url: Option<String>,
21    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
22    pub display: Option<String>,
23    #[serde(rename = "device")]
24    pub device: Box<crate::models::BriefDevice>,
25    #[serde(rename = "vdcs", skip_serializing_if = "Option::is_none")]
26    pub vdcs: Option<Vec<crate::models::VirtualDeviceContext>>,
27    #[serde(
28        rename = "module",
29        default,
30        with = "::serde_with::rust::double_option",
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub module: Option<Option<Box<crate::models::BriefModule>>>,
34    #[serde(rename = "name")]
35    pub name: String,
36    /// Physical label
37    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
38    pub label: Option<String>,
39    #[serde(rename = "type")]
40    pub r#type: Box<crate::models::InterfaceType>,
41    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
42    pub enabled: Option<bool>,
43    #[serde(
44        rename = "parent",
45        default,
46        with = "::serde_with::rust::double_option",
47        skip_serializing_if = "Option::is_none"
48    )]
49    pub parent: Option<Option<Box<crate::models::NestedInterface>>>,
50    #[serde(
51        rename = "bridge",
52        default,
53        with = "::serde_with::rust::double_option",
54        skip_serializing_if = "Option::is_none"
55    )]
56    pub bridge: Option<Option<Box<crate::models::NestedInterface>>>,
57    #[serde(rename = "bridge_interfaces", skip_serializing_if = "Option::is_none")]
58    pub bridge_interfaces: Option<Vec<crate::models::NestedInterface>>,
59    #[serde(
60        rename = "lag",
61        default,
62        with = "::serde_with::rust::double_option",
63        skip_serializing_if = "Option::is_none"
64    )]
65    pub lag: Option<Option<Box<crate::models::NestedInterface>>>,
66    #[serde(
67        rename = "mtu",
68        default,
69        with = "::serde_with::rust::double_option",
70        skip_serializing_if = "Option::is_none"
71    )]
72    pub mtu: Option<Option<i32>>,
73    #[serde(
74        rename = "mac_address",
75        default,
76        with = "::serde_with::rust::double_option",
77        skip_serializing_if = "Option::is_none"
78    )]
79    pub mac_address: Option<Option<String>>,
80    #[serde(
81        rename = "primary_mac_address",
82        default,
83        with = "::serde_with::rust::double_option",
84        skip_serializing_if = "Option::is_none"
85    )]
86    pub primary_mac_address: Option<Option<Box<crate::models::BriefMacAddress>>>,
87    #[serde(
88        rename = "mac_addresses",
89        default,
90        with = "::serde_with::rust::double_option",
91        skip_serializing_if = "Option::is_none"
92    )]
93    pub mac_addresses: Option<Option<Vec<crate::models::BriefMacAddress>>>,
94    #[serde(
95        rename = "speed",
96        default,
97        with = "::serde_with::rust::double_option",
98        skip_serializing_if = "Option::is_none"
99    )]
100    pub speed: Option<Option<i64>>,
101    #[serde(
102        rename = "duplex",
103        default,
104        with = "::serde_with::rust::double_option",
105        skip_serializing_if = "Option::is_none"
106    )]
107    pub duplex: Option<Option<Box<crate::models::InterfaceDuplex>>>,
108    #[serde(
109        rename = "wwn",
110        default,
111        with = "::serde_with::rust::double_option",
112        skip_serializing_if = "Option::is_none"
113    )]
114    pub wwn: Option<Option<String>>,
115    /// This interface is used only for out-of-band management
116    #[serde(rename = "mgmt_only", skip_serializing_if = "Option::is_none")]
117    pub mgmt_only: Option<bool>,
118    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
119    pub description: Option<String>,
120    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
121    pub mode: Option<Box<crate::models::InterfaceMode>>,
122    #[serde(rename = "rf_role", skip_serializing_if = "Option::is_none")]
123    pub rf_role: Option<Box<crate::models::InterfaceRfRole>>,
124    #[serde(rename = "rf_channel", skip_serializing_if = "Option::is_none")]
125    pub rf_channel: Option<Box<crate::models::InterfaceRfChannel>>,
126    #[serde(rename = "poe_mode", skip_serializing_if = "Option::is_none")]
127    pub poe_mode: Option<Box<crate::models::InterfacePoeMode>>,
128    #[serde(rename = "poe_type", skip_serializing_if = "Option::is_none")]
129    pub poe_type: Option<Box<crate::models::InterfacePoeType>>,
130    /// Populated by selected channel (if set)
131    #[serde(
132        rename = "rf_channel_frequency",
133        default,
134        with = "::serde_with::rust::double_option",
135        skip_serializing_if = "Option::is_none"
136    )]
137    pub rf_channel_frequency: Option<Option<f64>>,
138    /// Populated by selected channel (if set)
139    #[serde(
140        rename = "rf_channel_width",
141        default,
142        with = "::serde_with::rust::double_option",
143        skip_serializing_if = "Option::is_none"
144    )]
145    pub rf_channel_width: Option<Option<f64>>,
146    #[serde(
147        rename = "tx_power",
148        default,
149        with = "::serde_with::rust::double_option",
150        skip_serializing_if = "Option::is_none"
151    )]
152    pub tx_power: Option<Option<i32>>,
153    #[serde(
154        rename = "untagged_vlan",
155        default,
156        with = "::serde_with::rust::double_option",
157        skip_serializing_if = "Option::is_none"
158    )]
159    pub untagged_vlan: Option<Option<Box<crate::models::BriefVlan>>>,
160    #[serde(rename = "tagged_vlans", skip_serializing_if = "Option::is_none")]
161    pub tagged_vlans: Option<Vec<crate::models::Vlan>>,
162    #[serde(
163        rename = "qinq_svlan",
164        default,
165        with = "::serde_with::rust::double_option",
166        skip_serializing_if = "Option::is_none"
167    )]
168    pub qinq_svlan: Option<Option<Box<crate::models::BriefVlan>>>,
169    #[serde(
170        rename = "vlan_translation_policy",
171        default,
172        with = "::serde_with::rust::double_option",
173        skip_serializing_if = "Option::is_none"
174    )]
175    pub vlan_translation_policy: Option<Option<Box<crate::models::BriefVlanTranslationPolicy>>>,
176    /// Treat as if a cable is connected
177    #[serde(rename = "mark_connected", skip_serializing_if = "Option::is_none")]
178    pub mark_connected: Option<bool>,
179    #[serde(
180        rename = "cable",
181        default,
182        with = "::serde_with::rust::double_option",
183        skip_serializing_if = "Option::is_none"
184    )]
185    pub cable: Option<Option<Box<crate::models::BriefCable>>>,
186    #[serde(rename = "cable_end", skip_serializing_if = "Option::is_none")]
187    pub cable_end: Option<String>,
188    #[serde(
189        rename = "wireless_link",
190        default,
191        with = "::serde_with::rust::double_option",
192        skip_serializing_if = "Option::is_none"
193    )]
194    pub wireless_link: Option<Option<Box<crate::models::NestedWirelessLink>>>,
195    #[serde(rename = "link_peers", skip_serializing_if = "Option::is_none")]
196    pub link_peers: Option<Vec<serde_json::Value>>,
197    /// Return the type of the peer link terminations, or None.
198    #[serde(
199        rename = "link_peers_type",
200        default,
201        with = "::serde_with::rust::double_option",
202        skip_serializing_if = "Option::is_none"
203    )]
204    pub link_peers_type: Option<Option<String>>,
205    #[serde(rename = "wireless_lans", skip_serializing_if = "Option::is_none")]
206    pub wireless_lans: Option<Vec<crate::models::WirelessLan>>,
207    #[serde(
208        rename = "vrf",
209        default,
210        with = "::serde_with::rust::double_option",
211        skip_serializing_if = "Option::is_none"
212    )]
213    pub vrf: Option<Option<Box<crate::models::BriefVrf>>>,
214    #[serde(
215        rename = "l2vpn_termination",
216        default,
217        with = "::serde_with::rust::double_option",
218        skip_serializing_if = "Option::is_none"
219    )]
220    pub l2vpn_termination: Option<Option<Box<crate::models::BriefL2VpnTermination>>>,
221    #[serde(
222        rename = "connected_endpoints",
223        default,
224        with = "::serde_with::rust::double_option",
225        skip_serializing_if = "Option::is_none"
226    )]
227    pub connected_endpoints: Option<Option<Vec<serde_json::Value>>>,
228    #[serde(
229        rename = "connected_endpoints_type",
230        default,
231        with = "::serde_with::rust::double_option",
232        skip_serializing_if = "Option::is_none"
233    )]
234    pub connected_endpoints_type: Option<Option<String>>,
235    #[serde(
236        rename = "connected_endpoints_reachable",
237        skip_serializing_if = "Option::is_none"
238    )]
239    pub connected_endpoints_reachable: Option<bool>,
240    #[serde(
241        rename = "owner",
242        default,
243        with = "::serde_with::rust::double_option",
244        skip_serializing_if = "Option::is_none"
245    )]
246    pub owner: Option<Option<Box<crate::models::BriefOwner>>>,
247    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
248    pub tags: Option<Vec<crate::models::NestedTag>>,
249    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
250    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
251    #[serde(
252        rename = "created",
253        default,
254        with = "::serde_with::rust::double_option",
255        skip_serializing_if = "Option::is_none"
256    )]
257    pub created: Option<Option<String>>,
258    #[serde(
259        rename = "last_updated",
260        default,
261        with = "::serde_with::rust::double_option",
262        skip_serializing_if = "Option::is_none"
263    )]
264    pub last_updated: Option<Option<String>>,
265    #[serde(rename = "count_ipaddresses", skip_serializing_if = "Option::is_none")]
266    pub count_ipaddresses: Option<i32>,
267    #[serde(rename = "count_fhrp_groups", skip_serializing_if = "Option::is_none")]
268    pub count_fhrp_groups: Option<i32>,
269    #[serde(rename = "_occupied", skip_serializing_if = "Option::is_none")]
270    pub _occupied: Option<bool>,
271}
272
273impl Interface {
274    /// Adds an `owner` field for models which have a ForeignKey to users.Owner.
275    pub fn new(
276        device: crate::models::BriefDevice,
277        name: String,
278        r#type: crate::models::InterfaceType,
279    ) -> Interface {
280        Interface {
281            id: None,
282            url: None,
283            display_url: None,
284            display: None,
285            device: Box::new(device),
286            vdcs: None,
287            module: None,
288            name,
289            label: None,
290            r#type: Box::new(r#type),
291            enabled: None,
292            parent: None,
293            bridge: None,
294            bridge_interfaces: None,
295            lag: None,
296            mtu: None,
297            mac_address: None,
298            primary_mac_address: None,
299            mac_addresses: None,
300            speed: None,
301            duplex: None,
302            wwn: None,
303            mgmt_only: None,
304            description: None,
305            mode: None,
306            rf_role: None,
307            rf_channel: None,
308            poe_mode: None,
309            poe_type: None,
310            rf_channel_frequency: None,
311            rf_channel_width: None,
312            tx_power: None,
313            untagged_vlan: None,
314            tagged_vlans: None,
315            qinq_svlan: None,
316            vlan_translation_policy: None,
317            mark_connected: None,
318            cable: None,
319            cable_end: None,
320            wireless_link: None,
321            link_peers: None,
322            link_peers_type: None,
323            wireless_lans: None,
324            vrf: None,
325            l2vpn_termination: None,
326            connected_endpoints: None,
327            connected_endpoints_type: None,
328            connected_endpoints_reachable: None,
329            owner: None,
330            tags: None,
331            custom_fields: None,
332            created: None,
333            last_updated: None,
334            count_ipaddresses: None,
335            count_fhrp_groups: None,
336            _occupied: None,
337        }
338    }
339}