Skip to main content

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.6.8 (4.6)
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::BulkTunnelTerminationRequestTunnel>>,
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:
36        Option<Option<Box<crate::models::BulkDeviceWithConfigContextRequestPrimaryIp4>>>,
37    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
38    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
39    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
40    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
41}
42
43impl PatchedWritableTunnelTerminationRequest {
44    /// Adds support for custom fields and tags.
45    pub fn new() -> PatchedWritableTunnelTerminationRequest {
46        PatchedWritableTunnelTerminationRequest {
47            tunnel: None,
48            role: None,
49            termination_type: None,
50            termination_id: None,
51            outside_ip: None,
52            tags: None,
53            custom_fields: None,
54        }
55    }
56}
57
58/// * `peer` - Peer * `hub` - Hub * `spoke` - Spoke
59#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
60pub enum Role {
61    #[serde(rename = "peer")]
62    Peer,
63    #[serde(rename = "hub")]
64    Hub,
65    #[serde(rename = "spoke")]
66    Spoke,
67}
68
69impl Default for Role {
70    fn default() -> Role {
71        Self::Peer
72    }
73}