Skip to main content

netbox_openapi/models/
fhrp_group.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.2 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// FhrpGroup : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct FhrpGroup {
15    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
16    pub id: Option<i32>,
17    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
18    pub name: Option<String>,
19    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
20    pub url: Option<String>,
21    #[serde(rename = "display_url", skip_serializing_if = "Option::is_none")]
22    pub display_url: Option<String>,
23    #[serde(rename = "display", skip_serializing_if = "Option::is_none")]
24    pub display: Option<String>,
25    /// * `vrrp2` - VRRPv2 * `vrrp3` - VRRPv3 * `carp` - CARP * `clusterxl` - ClusterXL * `hsrp` - HSRP * `glbp` - GLBP * `other` - Other
26    #[serde(rename = "protocol")]
27    pub protocol: Protocol,
28    #[serde(rename = "group_id")]
29    pub group_id: i32,
30    /// * `plaintext` - Plaintext * `md5` - MD5
31    #[serde(
32        rename = "auth_type",
33        default,
34        with = "::serde_with::rust::double_option",
35        skip_serializing_if = "Option::is_none"
36    )]
37    pub auth_type: Option<Option<AuthType>>,
38    #[serde(rename = "auth_key", skip_serializing_if = "Option::is_none")]
39    pub auth_key: Option<String>,
40    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
41    pub description: Option<String>,
42    #[serde(
43        rename = "owner",
44        default,
45        with = "::serde_with::rust::double_option",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub owner: Option<Option<Box<crate::models::BriefOwner>>>,
49    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
50    pub comments: Option<String>,
51    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
52    pub tags: Option<Vec<crate::models::NestedTag>>,
53    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
54    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
55    #[serde(
56        rename = "created",
57        default,
58        with = "::serde_with::rust::double_option",
59        skip_serializing_if = "Option::is_none"
60    )]
61    pub created: Option<Option<String>>,
62    #[serde(
63        rename = "last_updated",
64        default,
65        with = "::serde_with::rust::double_option",
66        skip_serializing_if = "Option::is_none"
67    )]
68    pub last_updated: Option<Option<String>>,
69    #[serde(rename = "ip_addresses", skip_serializing_if = "Option::is_none")]
70    pub ip_addresses: Option<Vec<crate::models::BriefIpAddress>>,
71}
72
73impl FhrpGroup {
74    /// Base serializer class for models inheriting from PrimaryModel.
75    pub fn new(protocol: Protocol, group_id: i32) -> FhrpGroup {
76        FhrpGroup {
77            id: None,
78            name: None,
79            url: None,
80            display_url: None,
81            display: None,
82            protocol,
83            group_id,
84            auth_type: None,
85            auth_key: None,
86            description: None,
87            owner: None,
88            comments: None,
89            tags: None,
90            custom_fields: None,
91            created: None,
92            last_updated: None,
93            ip_addresses: None,
94        }
95    }
96}
97
98/// * `vrrp2` - VRRPv2 * `vrrp3` - VRRPv3 * `carp` - CARP * `clusterxl` - ClusterXL * `hsrp` - HSRP * `glbp` - GLBP * `other` - Other
99#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
100pub enum Protocol {
101    #[serde(rename = "vrrp2")]
102    Vrrp2,
103    #[serde(rename = "vrrp3")]
104    Vrrp3,
105    #[serde(rename = "carp")]
106    Carp,
107    #[serde(rename = "clusterxl")]
108    Clusterxl,
109    #[serde(rename = "hsrp")]
110    Hsrp,
111    #[serde(rename = "glbp")]
112    Glbp,
113    #[serde(rename = "other")]
114    Other,
115}
116
117impl Default for Protocol {
118    fn default() -> Protocol {
119        Self::Vrrp2
120    }
121}
122/// * `plaintext` - Plaintext * `md5` - MD5
123#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
124pub enum AuthType {
125    #[serde(rename = "plaintext")]
126    Plaintext,
127    #[serde(rename = "md5")]
128    Md5,
129    #[serde(rename = "")]
130    Empty,
131    #[serde(rename = "null")]
132    Null,
133}
134
135impl Default for AuthType {
136    fn default() -> AuthType {
137        Self::Plaintext
138    }
139}