Skip to main content

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