netbox_openapi/models/
patched_circuit_termination_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/// PatchedCircuitTerminationRequest : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedCircuitTerminationRequest {
15    #[serde(rename = "circuit", skip_serializing_if = "Option::is_none")]
16    pub circuit: Option<Box<crate::models::CircuitTerminationRequestCircuit>>,
17    /// * `A` - A * `Z` - Z
18    #[serde(rename = "term_side", skip_serializing_if = "Option::is_none")]
19    pub term_side: Option<TermSide>,
20    #[serde(
21        rename = "termination_type",
22        default,
23        with = "::serde_with::rust::double_option",
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub termination_type: Option<Option<String>>,
27    #[serde(
28        rename = "termination_id",
29        default,
30        with = "::serde_with::rust::double_option",
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub termination_id: Option<Option<i32>>,
34    /// Physical circuit speed
35    #[serde(
36        rename = "port_speed",
37        default,
38        with = "::serde_with::rust::double_option",
39        skip_serializing_if = "Option::is_none"
40    )]
41    pub port_speed: Option<Option<i32>>,
42    /// Upstream speed, if different from port speed
43    #[serde(
44        rename = "upstream_speed",
45        default,
46        with = "::serde_with::rust::double_option",
47        skip_serializing_if = "Option::is_none"
48    )]
49    pub upstream_speed: Option<Option<i32>>,
50    /// ID of the local cross-connect
51    #[serde(rename = "xconnect_id", skip_serializing_if = "Option::is_none")]
52    pub xconnect_id: Option<String>,
53    /// Patch panel ID and port number(s)
54    #[serde(rename = "pp_info", skip_serializing_if = "Option::is_none")]
55    pub pp_info: Option<String>,
56    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
57    pub description: Option<String>,
58    /// Treat as if a cable is connected
59    #[serde(rename = "mark_connected", skip_serializing_if = "Option::is_none")]
60    pub mark_connected: Option<bool>,
61    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
62    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
63    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
64    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
65}
66
67impl PatchedCircuitTerminationRequest {
68    /// Adds support for custom fields and tags.
69    pub fn new() -> PatchedCircuitTerminationRequest {
70        PatchedCircuitTerminationRequest {
71            circuit: None,
72            term_side: None,
73            termination_type: None,
74            termination_id: None,
75            port_speed: None,
76            upstream_speed: None,
77            xconnect_id: None,
78            pp_info: None,
79            description: None,
80            mark_connected: None,
81            tags: None,
82            custom_fields: None,
83        }
84    }
85}
86
87/// * `A` - A * `Z` - Z
88#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
89pub enum TermSide {
90    #[serde(rename = "A")]
91    A,
92    #[serde(rename = "Z")]
93    Z,
94}
95
96impl Default for TermSide {
97    fn default() -> TermSide {
98        Self::A
99    }
100}