Skip to main content

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.6.2 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// Cable : Base serializer class for models inheriting from PrimaryModel.
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 * `rg-6` - RG-6 * `rg-8` - RG-8 * `rg-11` - RG-11 * `rg-59` - RG-59 * `rg-62` - RG-62 * `rg-213` - RG-213 * `lmr-100` - LMR-100 * `lmr-200` - LMR-200 * `lmr-400` - LMR-400 * `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(rename = "profile", skip_serializing_if = "Option::is_none")]
38    pub profile: Option<Box<crate::models::CableProfile>>,
39    #[serde(
40        rename = "tenant",
41        default,
42        with = "::serde_with::rust::double_option",
43        skip_serializing_if = "Option::is_none"
44    )]
45    pub tenant: Option<Option<Box<crate::models::BriefTenant>>>,
46    #[serde(
47        rename = "bundle",
48        default,
49        with = "::serde_with::rust::double_option",
50        skip_serializing_if = "Option::is_none"
51    )]
52    pub bundle: Option<Option<Box<crate::models::BriefCableBundle>>>,
53    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
54    pub label: Option<String>,
55    #[serde(rename = "color", skip_serializing_if = "Option::is_none")]
56    pub color: Option<String>,
57    #[serde(
58        rename = "length",
59        default,
60        with = "::serde_with::rust::double_option",
61        skip_serializing_if = "Option::is_none"
62    )]
63    pub length: Option<Option<f64>>,
64    #[serde(
65        rename = "length_unit",
66        default,
67        with = "::serde_with::rust::double_option",
68        skip_serializing_if = "Option::is_none"
69    )]
70    pub length_unit: Option<Option<Box<crate::models::CableLengthUnit>>>,
71    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
72    pub description: Option<String>,
73    #[serde(
74        rename = "owner",
75        default,
76        with = "::serde_with::rust::double_option",
77        skip_serializing_if = "Option::is_none"
78    )]
79    pub owner: Option<Option<Box<crate::models::BriefOwner>>>,
80    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
81    pub comments: Option<String>,
82    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
83    pub tags: Option<Vec<crate::models::NestedTag>>,
84    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
85    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
86    #[serde(
87        rename = "created",
88        default,
89        with = "::serde_with::rust::double_option",
90        skip_serializing_if = "Option::is_none"
91    )]
92    pub created: Option<Option<String>>,
93    #[serde(
94        rename = "last_updated",
95        default,
96        with = "::serde_with::rust::double_option",
97        skip_serializing_if = "Option::is_none"
98    )]
99    pub last_updated: Option<Option<String>>,
100}
101
102impl Cable {
103    /// Base serializer class for models inheriting from PrimaryModel.
104    pub fn new() -> Cable {
105        Cable {
106            id: None,
107            url: None,
108            display_url: None,
109            display: None,
110            r#type: None,
111            a_terminations: None,
112            b_terminations: None,
113            status: None,
114            profile: None,
115            tenant: None,
116            bundle: None,
117            label: None,
118            color: None,
119            length: None,
120            length_unit: None,
121            description: None,
122            owner: None,
123            comments: None,
124            tags: None,
125            custom_fields: None,
126            created: None,
127            last_updated: None,
128        }
129    }
130}
131
132/// * `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 * `rg-6` - RG-6 * `rg-8` - RG-8 * `rg-11` - RG-11 * `rg-59` - RG-59 * `rg-62` - RG-62 * `rg-213` - RG-213 * `lmr-100` - LMR-100 * `lmr-200` - LMR-200 * `lmr-400` - LMR-400 * `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
133#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
134pub enum RHashType {
135    #[serde(rename = "cat3")]
136    Cat3,
137    #[serde(rename = "cat5")]
138    Cat5,
139    #[serde(rename = "cat5e")]
140    Cat5e,
141    #[serde(rename = "cat6")]
142    Cat6,
143    #[serde(rename = "cat6a")]
144    Cat6a,
145    #[serde(rename = "cat7")]
146    Cat7,
147    #[serde(rename = "cat7a")]
148    Cat7a,
149    #[serde(rename = "cat8")]
150    Cat8,
151    #[serde(rename = "mrj21-trunk")]
152    Mrj21Trunk,
153    #[serde(rename = "dac-active")]
154    DacActive,
155    #[serde(rename = "dac-passive")]
156    DacPassive,
157    #[serde(rename = "coaxial")]
158    Coaxial,
159    #[serde(rename = "rg-6")]
160    Rg6,
161    #[serde(rename = "rg-8")]
162    Rg8,
163    #[serde(rename = "rg-11")]
164    Rg11,
165    #[serde(rename = "rg-59")]
166    Rg59,
167    #[serde(rename = "rg-62")]
168    Rg62,
169    #[serde(rename = "rg-213")]
170    Rg213,
171    #[serde(rename = "lmr-100")]
172    Lmr100,
173    #[serde(rename = "lmr-200")]
174    Lmr200,
175    #[serde(rename = "lmr-400")]
176    Lmr400,
177    #[serde(rename = "mmf")]
178    Mmf,
179    #[serde(rename = "mmf-om1")]
180    MmfOm1,
181    #[serde(rename = "mmf-om2")]
182    MmfOm2,
183    #[serde(rename = "mmf-om3")]
184    MmfOm3,
185    #[serde(rename = "mmf-om4")]
186    MmfOm4,
187    #[serde(rename = "mmf-om5")]
188    MmfOm5,
189    #[serde(rename = "smf")]
190    Smf,
191    #[serde(rename = "smf-os1")]
192    SmfOs1,
193    #[serde(rename = "smf-os2")]
194    SmfOs2,
195    #[serde(rename = "aoc")]
196    Aoc,
197    #[serde(rename = "power")]
198    Power,
199    #[serde(rename = "usb")]
200    Usb,
201    #[serde(rename = "")]
202    Empty,
203    #[serde(rename = "null")]
204    Null,
205}
206
207impl Default for RHashType {
208    fn default() -> RHashType {
209        Self::Cat3
210    }
211}