Skip to main content

netbox_openapi/models/
patched_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/// PatchedBulkTunnelTerminationRequest : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct PatchedBulkTunnelTerminationRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "tunnel", skip_serializing_if = "Option::is_none")]
18    pub tunnel: Option<Box<crate::models::BulkTunnelTerminationRequestTunnel>>,
19    /// * `peer` - Peer * `hub` - Hub * `spoke` - Spoke
20    #[serde(rename = "role", skip_serializing_if = "Option::is_none")]
21    pub role: Option<Role>,
22    #[serde(rename = "termination_type", skip_serializing_if = "Option::is_none")]
23    pub termination_type: Option<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 PatchedBulkTunnelTerminationRequest {
46    /// Adds support for custom fields and tags.
47    pub fn new(id: i32) -> PatchedBulkTunnelTerminationRequest {
48        PatchedBulkTunnelTerminationRequest {
49            id,
50            tunnel: None,
51            role: None,
52            termination_type: None,
53            termination_id: None,
54            outside_ip: None,
55            tags: None,
56            custom_fields: None,
57        }
58    }
59}
60
61/// * `peer` - Peer * `hub` - Hub * `spoke` - Spoke
62#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
63pub enum Role {
64    #[serde(rename = "peer")]
65    Peer,
66    #[serde(rename = "hub")]
67    Hub,
68    #[serde(rename = "spoke")]
69    Spoke,
70}
71
72impl Default for Role {
73    fn default() -> Role {
74        Self::Peer
75    }
76}