netbox_openapi/models/
tunnel_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/// TunnelTermination : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct TunnelTermination {
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 = "tunnel")]
24    pub tunnel: Box<crate::models::BriefTunnel>,
25    #[serde(rename = "role")]
26    pub role: Box<crate::models::TunnelTerminationRole>,
27    #[serde(rename = "termination_type")]
28    pub termination_type: 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<i64>>,
36    #[serde(
37        rename = "termination",
38        default,
39        with = "::serde_with::rust::double_option",
40        skip_serializing_if = "Option::is_none"
41    )]
42    pub termination: Option<Option<serde_json::Value>>,
43    #[serde(
44        rename = "outside_ip",
45        default,
46        with = "::serde_with::rust::double_option",
47        skip_serializing_if = "Option::is_none"
48    )]
49    pub outside_ip: Option<Option<Box<crate::models::BriefIpAddress>>>,
50    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
51    pub tags: Option<Vec<crate::models::NestedTag>>,
52    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
53    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
54    #[serde(
55        rename = "created",
56        default,
57        with = "::serde_with::rust::double_option",
58        skip_serializing_if = "Option::is_none"
59    )]
60    pub created: Option<Option<String>>,
61    #[serde(
62        rename = "last_updated",
63        default,
64        with = "::serde_with::rust::double_option",
65        skip_serializing_if = "Option::is_none"
66    )]
67    pub last_updated: Option<Option<String>>,
68}
69
70impl TunnelTermination {
71    /// Adds support for custom fields and tags.
72    pub fn new(
73        tunnel: crate::models::BriefTunnel,
74        role: crate::models::TunnelTerminationRole,
75        termination_type: String,
76    ) -> TunnelTermination {
77        TunnelTermination {
78            id: None,
79            url: None,
80            display_url: None,
81            display: None,
82            tunnel: Box::new(tunnel),
83            role: Box::new(role),
84            termination_type,
85            termination_id: None,
86            termination: None,
87            outside_ip: None,
88            tags: None,
89            custom_fields: None,
90            created: None,
91            last_updated: None,
92        }
93    }
94}