netbox_openapi/models/
writable_cable_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.4.2-Docker-3.4.1 (4.4)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// WritableCableRequest : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct WritableCableRequest {
15    /// * `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
16    #[serde(
17        rename = "type",
18        default,
19        with = "::serde_with::rust::double_option",
20        skip_serializing_if = "Option::is_none"
21    )]
22    pub r#type: Option<Option<RHashType>>,
23    #[serde(rename = "a_terminations", skip_serializing_if = "Option::is_none")]
24    pub a_terminations: Option<Vec<crate::models::GenericObjectRequest>>,
25    #[serde(rename = "b_terminations", skip_serializing_if = "Option::is_none")]
26    pub b_terminations: Option<Vec<crate::models::GenericObjectRequest>>,
27    /// * `connected` - Connected * `planned` - Planned * `decommissioning` - Decommissioning
28    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
29    pub status: Option<Status>,
30    #[serde(
31        rename = "tenant",
32        default,
33        with = "::serde_with::rust::double_option",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub tenant: Option<Option<Box<crate::models::AsnRangeRequestTenant>>>,
37    #[serde(rename = "label", skip_serializing_if = "Option::is_none")]
38    pub label: Option<String>,
39    #[serde(rename = "color", skip_serializing_if = "Option::is_none")]
40    pub color: Option<String>,
41    #[serde(
42        rename = "length",
43        default,
44        with = "::serde_with::rust::double_option",
45        skip_serializing_if = "Option::is_none"
46    )]
47    pub length: Option<Option<f64>>,
48    /// * `km` - Kilometers * `m` - Meters * `cm` - Centimeters * `mi` - Miles * `ft` - Feet * `in` - Inches
49    #[serde(
50        rename = "length_unit",
51        default,
52        with = "::serde_with::rust::double_option",
53        skip_serializing_if = "Option::is_none"
54    )]
55    pub length_unit: Option<Option<LengthUnit>>,
56    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
57    pub description: Option<String>,
58    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
59    pub comments: Option<String>,
60    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
61    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
62    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
63    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
64}
65
66impl WritableCableRequest {
67    /// Adds support for custom fields and tags.
68    pub fn new() -> WritableCableRequest {
69        WritableCableRequest {
70            r#type: None,
71            a_terminations: None,
72            b_terminations: None,
73            status: None,
74            tenant: None,
75            label: None,
76            color: None,
77            length: None,
78            length_unit: None,
79            description: None,
80            comments: None,
81            tags: None,
82            custom_fields: None,
83        }
84    }
85}
86
87/// * `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
88#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
89pub enum RHashType {
90    #[serde(rename = "cat3")]
91    Cat3,
92    #[serde(rename = "cat5")]
93    Cat5,
94    #[serde(rename = "cat5e")]
95    Cat5e,
96    #[serde(rename = "cat6")]
97    Cat6,
98    #[serde(rename = "cat6a")]
99    Cat6a,
100    #[serde(rename = "cat7")]
101    Cat7,
102    #[serde(rename = "cat7a")]
103    Cat7a,
104    #[serde(rename = "cat8")]
105    Cat8,
106    #[serde(rename = "mrj21-trunk")]
107    Mrj21Trunk,
108    #[serde(rename = "dac-active")]
109    DacActive,
110    #[serde(rename = "dac-passive")]
111    DacPassive,
112    #[serde(rename = "coaxial")]
113    Coaxial,
114    #[serde(rename = "mmf")]
115    Mmf,
116    #[serde(rename = "mmf-om1")]
117    MmfOm1,
118    #[serde(rename = "mmf-om2")]
119    MmfOm2,
120    #[serde(rename = "mmf-om3")]
121    MmfOm3,
122    #[serde(rename = "mmf-om4")]
123    MmfOm4,
124    #[serde(rename = "mmf-om5")]
125    MmfOm5,
126    #[serde(rename = "smf")]
127    Smf,
128    #[serde(rename = "smf-os1")]
129    SmfOs1,
130    #[serde(rename = "smf-os2")]
131    SmfOs2,
132    #[serde(rename = "aoc")]
133    Aoc,
134    #[serde(rename = "power")]
135    Power,
136    #[serde(rename = "usb")]
137    Usb,
138    #[serde(rename = "")]
139    Empty,
140    #[serde(rename = "null")]
141    Null,
142}
143
144impl Default for RHashType {
145    fn default() -> RHashType {
146        Self::Cat3
147    }
148}
149/// * `connected` - Connected * `planned` - Planned * `decommissioning` - Decommissioning
150#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
151pub enum Status {
152    #[serde(rename = "connected")]
153    Connected,
154    #[serde(rename = "planned")]
155    Planned,
156    #[serde(rename = "decommissioning")]
157    Decommissioning,
158}
159
160impl Default for Status {
161    fn default() -> Status {
162        Self::Connected
163    }
164}
165/// * `km` - Kilometers * `m` - Meters * `cm` - Centimeters * `mi` - Miles * `ft` - Feet * `in` - Inches
166#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
167pub enum LengthUnit {
168    #[serde(rename = "km")]
169    Km,
170    #[serde(rename = "m")]
171    M,
172    #[serde(rename = "cm")]
173    Cm,
174    #[serde(rename = "mi")]
175    Mi,
176    #[serde(rename = "ft")]
177    Ft,
178    #[serde(rename = "in")]
179    In,
180    #[serde(rename = "")]
181    Empty,
182    #[serde(rename = "null")]
183    Null,
184}
185
186impl Default for LengthUnit {
187    fn default() -> LengthUnit {
188        Self::Km
189    }
190}