netbox_openapi/models/
patched_writable_tunnel_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/// PatchedWritableTunnelTerminationRequest : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedWritableTunnelTerminationRequest {
15    #[serde(rename = "tunnel", skip_serializing_if = "Option::is_none")]
16    pub tunnel: Option<Box<crate::models::PatchedWritableTunnelTerminationRequestTunnel>>,
17    /// * `peer` - Peer * `hub` - Hub * `spoke` - Spoke
18    #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
19    pub role: Option<Role>,
20    #[serde(rename = "termination_type", skip_serializing_if = "Option::is_none")]
21    pub termination_type: Option<String>,
22    #[serde(
23        rename = "termination_id",
24        default,
25        with = "::serde_with::rust::double_option",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub termination_id: Option<Option<i64>>,
29    #[serde(
30        rename = "outside_ip",
31        default,
32        with = "::serde_with::rust::double_option",
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub outside_ip: Option<Option<Box<crate::models::DeviceWithConfigContextRequestPrimaryIp4>>>,
36    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
37    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
38    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
39    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
40}
41
42impl PatchedWritableTunnelTerminationRequest {
43    /// Adds support for custom fields and tags.
44    pub fn new() -> PatchedWritableTunnelTerminationRequest {
45        PatchedWritableTunnelTerminationRequest {
46            tunnel: None,
47            role: None,
48            termination_type: None,
49            termination_id: None,
50            outside_ip: None,
51            tags: None,
52            custom_fields: None,
53        }
54    }
55}
56
57/// * `peer` - Peer * `hub` - Hub * `spoke` - Spoke
58#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
59pub enum Role {
60    #[serde(rename = "peer")]
61    Peer,
62    #[serde(rename = "hub")]
63    Hub,
64    #[serde(rename = "spoke")]
65    Spoke,
66}
67
68impl Default for Role {
69    fn default() -> Role {
70        Self::Peer
71    }
72}