netbox_openapi/models/
cable_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/// CableTermination : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct CableTermination {
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", skip_serializing_if = "Option::is_none")]
20    pub display: Option<String>,
21    #[serde(rename = "cable")]
22    pub cable: i32,
23    /// * `A` - A * `B` - B
24    #[serde(rename = "cable_end")]
25    pub cable_end: CableEnd,
26    #[serde(rename = "termination_type")]
27    pub termination_type: String,
28    #[serde(rename = "termination_id")]
29    pub termination_id: i64,
30    #[serde(
31        rename = "termination",
32        default,
33        with = "::serde_with::rust::double_option",
34        skip_serializing_if = "Option::is_none"
35    )]
36    pub termination: Option<Option<serde_json::Value>>,
37    #[serde(
38        rename = "created",
39        default,
40        with = "::serde_with::rust::double_option",
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub created: Option<Option<String>>,
44    #[serde(
45        rename = "last_updated",
46        default,
47        with = "::serde_with::rust::double_option",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub last_updated: Option<Option<String>>,
51}
52
53impl CableTermination {
54    /// Adds support for custom fields and tags.
55    pub fn new(
56        cable: i32,
57        cable_end: CableEnd,
58        termination_type: String,
59        termination_id: i64,
60    ) -> CableTermination {
61        CableTermination {
62            id: None,
63            url: None,
64            display: None,
65            cable,
66            cable_end,
67            termination_type,
68            termination_id,
69            termination: None,
70            created: None,
71            last_updated: None,
72        }
73    }
74}
75
76/// * `A` - A * `B` - B
77#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
78pub enum CableEnd {
79    #[serde(rename = "A")]
80    A,
81    #[serde(rename = "B")]
82    B,
83}
84
85impl Default for CableEnd {
86    fn default() -> CableEnd {
87        Self::A
88    }
89}