Skip to main content

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