netbox_openapi/models/
cable.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.4.2-Docker-3.4.1 (4.4)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// Cable : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct Cable {
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    /// * `cat3` - CAT3 * `cat5` - CAT5 * `cat5e` - CAT5e * `cat6` - CAT6 * `cat6a` - CAT6a * `cat7` - CAT7 * `cat7a` - CAT7a * `cat8` - CAT8 * `mrj21-trunk` - MRJ21 Trunk * `dac-active` - Direct Attach Copper (Active) * `dac-passive` - Direct Attach Copper (Passive) * `coaxial` - Coaxial * `mmf` - Multimode Fiber * `mmf-om1` - Multimode Fiber (OM1) * `mmf-om2` - Multimode Fiber (OM2) * `mmf-om3` - Multimode Fiber (OM3) * `mmf-om4` - Multimode Fiber (OM4) * `mmf-om5` - Multimode Fiber (OM5) * `smf` - Single-mode Fiber * `smf-os1` - Single-mode Fiber (OS1) * `smf-os2` - Single-mode Fiber (OS2) * `aoc` - Active Optical Cabling (AOC) * `power` - Power * `usb` - USB
24    #[serde(
25        rename = "type",
26        default,
27        with = "::serde_with::rust::double_option",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub r#type: Option<Option<RHashType>>,
31    #[serde(rename = "a_terminations", skip_serializing_if = "Option::is_none")]
32    pub a_terminations: Option<Vec<crate::models::GenericObject>>,
33    #[serde(rename = "b_terminations", skip_serializing_if = "Option::is_none")]
34    pub b_terminations: Option<Vec<crate::models::GenericObject>>,
35    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
36    pub status: Option<Box<crate::models::CableStatus>>,
37    #[serde(
38        rename = "tenant",
39        default,
40        with = "::serde_with::rust::double_option",
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub tenant: Option<Option<Box<crate::models::BriefTenant>>>,
44    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
45    pub label: Option<String>,
46    #[serde(rename = "color", skip_serializing_if = "Option::is_none")]
47    pub color: Option<String>,
48    #[serde(
49        rename = "length",
50        default,
51        with = "::serde_with::rust::double_option",
52        skip_serializing_if = "Option::is_none"
53    )]
54    pub length: Option<Option<f64>>,
55    #[serde(
56        rename = "length_unit",
57        default,
58        with = "::serde_with::rust::double_option",
59        skip_serializing_if = "Option::is_none"
60    )]
61    pub length_unit: Option<Option<Box<crate::models::CableLengthUnit>>>,
62    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
63    pub description: Option<String>,
64    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
65    pub comments: Option<String>,
66    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
67    pub tags: Option<Vec<crate::models::NestedTag>>,
68    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
69    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
70    #[serde(
71        rename = "created",
72        default,
73        with = "::serde_with::rust::double_option",
74        skip_serializing_if = "Option::is_none"
75    )]
76    pub created: Option<Option<String>>,
77    #[serde(
78        rename = "last_updated",
79        default,
80        with = "::serde_with::rust::double_option",
81        skip_serializing_if = "Option::is_none"
82    )]
83    pub last_updated: Option<Option<String>>,
84}
85
86impl Cable {
87    /// Adds support for custom fields and tags.
88    pub fn new() -> Cable {
89        Cable {
90            id: None,
91            url: None,
92            display_url: None,
93            display: None,
94            r#type: None,
95            a_terminations: None,
96            b_terminations: None,
97            status: None,
98            tenant: None,
99            label: None,
100            color: None,
101            length: None,
102            length_unit: None,
103            description: None,
104            comments: None,
105            tags: None,
106            custom_fields: None,
107            created: None,
108            last_updated: None,
109        }
110    }
111}
112
113/// * `cat3` - CAT3 * `cat5` - CAT5 * `cat5e` - CAT5e * `cat6` - CAT6 * `cat6a` - CAT6a * `cat7` - CAT7 * `cat7a` - CAT7a * `cat8` - CAT8 * `mrj21-trunk` - MRJ21 Trunk * `dac-active` - Direct Attach Copper (Active) * `dac-passive` - Direct Attach Copper (Passive) * `coaxial` - Coaxial * `mmf` - Multimode Fiber * `mmf-om1` - Multimode Fiber (OM1) * `mmf-om2` - Multimode Fiber (OM2) * `mmf-om3` - Multimode Fiber (OM3) * `mmf-om4` - Multimode Fiber (OM4) * `mmf-om5` - Multimode Fiber (OM5) * `smf` - Single-mode Fiber * `smf-os1` - Single-mode Fiber (OS1) * `smf-os2` - Single-mode Fiber (OS2) * `aoc` - Active Optical Cabling (AOC) * `power` - Power * `usb` - USB
114#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
115pub enum RHashType {
116    #[serde(rename = "cat3")]
117    Cat3,
118    #[serde(rename = "cat5")]
119    Cat5,
120    #[serde(rename = "cat5e")]
121    Cat5e,
122    #[serde(rename = "cat6")]
123    Cat6,
124    #[serde(rename = "cat6a")]
125    Cat6a,
126    #[serde(rename = "cat7")]
127    Cat7,
128    #[serde(rename = "cat7a")]
129    Cat7a,
130    #[serde(rename = "cat8")]
131    Cat8,
132    #[serde(rename = "mrj21-trunk")]
133    Mrj21Trunk,
134    #[serde(rename = "dac-active")]
135    DacActive,
136    #[serde(rename = "dac-passive")]
137    DacPassive,
138    #[serde(rename = "coaxial")]
139    Coaxial,
140    #[serde(rename = "mmf")]
141    Mmf,
142    #[serde(rename = "mmf-om1")]
143    MmfOm1,
144    #[serde(rename = "mmf-om2")]
145    MmfOm2,
146    #[serde(rename = "mmf-om3")]
147    MmfOm3,
148    #[serde(rename = "mmf-om4")]
149    MmfOm4,
150    #[serde(rename = "mmf-om5")]
151    MmfOm5,
152    #[serde(rename = "smf")]
153    Smf,
154    #[serde(rename = "smf-os1")]
155    SmfOs1,
156    #[serde(rename = "smf-os2")]
157    SmfOs2,
158    #[serde(rename = "aoc")]
159    Aoc,
160    #[serde(rename = "power")]
161    Power,
162    #[serde(rename = "usb")]
163    Usb,
164    #[serde(rename = "")]
165    Empty,
166    #[serde(rename = "null")]
167    Null,
168}
169
170impl Default for RHashType {
171    fn default() -> RHashType {
172        Self::Cat3
173    }
174}