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.4.2-Docker-3.4.1 (4.4)
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    #[serde(rename = "cable_end", skip_serializing_if = "Option::is_none")]
84    pub cable_end: Option<String>,
85    #[serde(rename = "link_peers", skip_serializing_if = "Option::is_none")]
86    pub link_peers: Option<Vec<serde_json::Value>>,
87    /// Return the type of the peer link terminations, or None.
88    #[serde(
89        rename = "link_peers_type",
90        default,
91        with = "::serde_with::rust::double_option",
92        skip_serializing_if = "Option::is_none"
93    )]
94    pub link_peers_type: Option<Option<String>>,
95    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
96    pub tags: Option<Vec<crate::models::NestedTag>>,
97    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
98    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
99    #[serde(
100        rename = "created",
101        default,
102        with = "::serde_with::rust::double_option",
103        skip_serializing_if = "Option::is_none"
104    )]
105    pub created: Option<Option<String>>,
106    #[serde(
107        rename = "last_updated",
108        default,
109        with = "::serde_with::rust::double_option",
110        skip_serializing_if = "Option::is_none"
111    )]
112    pub last_updated: Option<Option<String>>,
113    #[serde(rename = "_occupied", skip_serializing_if = "Option::is_none")]
114    pub _occupied: Option<bool>,
115}
116
117impl CircuitTermination {
118    /// Adds support for custom fields and tags.
119    pub fn new(circuit: crate::models::BriefCircuit, term_side: TermSide) -> CircuitTermination {
120        CircuitTermination {
121            id: None,
122            url: None,
123            display_url: None,
124            display: None,
125            circuit: Box::new(circuit),
126            term_side,
127            termination_type: None,
128            termination_id: None,
129            termination: None,
130            port_speed: None,
131            upstream_speed: None,
132            xconnect_id: None,
133            pp_info: None,
134            description: None,
135            mark_connected: None,
136            cable: None,
137            cable_end: None,
138            link_peers: None,
139            link_peers_type: None,
140            tags: None,
141            custom_fields: None,
142            created: None,
143            last_updated: None,
144            _occupied: None,
145        }
146    }
147}
148
149/// * `A` - A * `Z` - Z
150#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
151pub enum TermSide {
152    #[serde(rename = "A")]
153    A,
154    #[serde(rename = "Z")]
155    Z,
156}
157
158impl Default for TermSide {
159    fn default() -> TermSide {
160        Self::A
161    }
162}