Skip to main content

netbox_openapi/models/
circuit_termination.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/// CircuitTermination : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct CircuitTermination {
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 = "circuit")]
24    pub circuit: Box<crate::models::BriefCircuit>,
25    /// * `A` - A * `Z` - Z
26    #[serde(rename = "term_side")]
27    pub term_side: TermSide,
28    #[serde(
29        rename = "termination_type",
30        default,
31        with = "::serde_with::rust::double_option",
32        skip_serializing_if = "Option::is_none"
33    )]
34    pub termination_type: Option<Option<String>>,
35    #[serde(
36        rename = "termination_id",
37        default,
38        with = "::serde_with::rust::double_option",
39        skip_serializing_if = "Option::is_none"
40    )]
41    pub termination_id: Option<Option<i32>>,
42    #[serde(
43        rename = "termination",
44        default,
45        with = "::serde_with::rust::double_option",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub termination: Option<Option<serde_json::Value>>,
49    /// Physical circuit speed
50    #[serde(
51        rename = "port_speed",
52        default,
53        with = "::serde_with::rust::double_option",
54        skip_serializing_if = "Option::is_none"
55    )]
56    pub port_speed: Option<Option<i32>>,
57    /// Upstream speed, if different from port speed
58    #[serde(
59        rename = "upstream_speed",
60        default,
61        with = "::serde_with::rust::double_option",
62        skip_serializing_if = "Option::is_none"
63    )]
64    pub upstream_speed: Option<Option<i32>>,
65    /// ID of the local cross-connect
66    #[serde(rename = "xconnect_id", skip_serializing_if = "Option::is_none")]
67    pub xconnect_id: Option<String>,
68    /// Patch panel ID and port number(s)
69    #[serde(rename = "pp_info", skip_serializing_if = "Option::is_none")]
70    pub pp_info: Option<String>,
71    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
72    pub description: Option<String>,
73    /// Treat as if a cable is connected
74    #[serde(rename = "mark_connected", skip_serializing_if = "Option::is_none")]
75    pub mark_connected: Option<bool>,
76    #[serde(
77        rename = "cable",
78        default,
79        with = "::serde_with::rust::double_option",
80        skip_serializing_if = "Option::is_none"
81    )]
82    pub cable: Option<Option<Box<crate::models::BriefCable>>>,
83    /// * `A` - A * `B` - B
84    #[serde(
85        rename = "cable_end",
86        default,
87        with = "::serde_with::rust::double_option",
88        skip_serializing_if = "Option::is_none"
89    )]
90    pub cable_end: Option<Option<CableEnd>>,
91    #[serde(rename = "link_peers", skip_serializing_if = "Option::is_none")]
92    pub link_peers: Option<Vec<serde_json::Value>>,
93    /// Return the type of the peer link terminations, or None.
94    #[serde(
95        rename = "link_peers_type",
96        default,
97        with = "::serde_with::rust::double_option",
98        skip_serializing_if = "Option::is_none"
99    )]
100    pub link_peers_type: Option<Option<String>>,
101    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
102    pub tags: Option<Vec<crate::models::NestedTag>>,
103    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
104    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
105    #[serde(
106        rename = "created",
107        default,
108        with = "::serde_with::rust::double_option",
109        skip_serializing_if = "Option::is_none"
110    )]
111    pub created: Option<Option<String>>,
112    #[serde(
113        rename = "last_updated",
114        default,
115        with = "::serde_with::rust::double_option",
116        skip_serializing_if = "Option::is_none"
117    )]
118    pub last_updated: Option<Option<String>>,
119    #[serde(rename = "_occupied", skip_serializing_if = "Option::is_none")]
120    pub _occupied: Option<bool>,
121}
122
123impl CircuitTermination {
124    /// Adds support for custom fields and tags.
125    pub fn new(circuit: crate::models::BriefCircuit, term_side: TermSide) -> CircuitTermination {
126        CircuitTermination {
127            id: None,
128            url: None,
129            display_url: None,
130            display: None,
131            circuit: Box::new(circuit),
132            term_side,
133            termination_type: None,
134            termination_id: None,
135            termination: None,
136            port_speed: None,
137            upstream_speed: None,
138            xconnect_id: None,
139            pp_info: None,
140            description: None,
141            mark_connected: None,
142            cable: None,
143            cable_end: None,
144            link_peers: None,
145            link_peers_type: None,
146            tags: None,
147            custom_fields: None,
148            created: None,
149            last_updated: None,
150            _occupied: None,
151        }
152    }
153}
154
155/// * `A` - A * `Z` - Z
156#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
157pub enum TermSide {
158    #[serde(rename = "A")]
159    A,
160    #[serde(rename = "Z")]
161    Z,
162}
163
164impl Default for TermSide {
165    fn default() -> TermSide {
166        Self::A
167    }
168}
169/// * `A` - A * `B` - B
170#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
171pub enum CableEnd {
172    #[serde(rename = "A")]
173    A,
174    #[serde(rename = "B")]
175    B,
176    #[serde(rename = "null")]
177    Null,
178}
179
180impl Default for CableEnd {
181    fn default() -> CableEnd {
182        Self::A
183    }
184}