Skip to main content

netbox_openapi/models/
bulk_fhrp_group_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/// BulkFhrpGroupRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct BulkFhrpGroupRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
18    pub name: Option<String>,
19    /// * `vrrp2` - VRRPv2 * `vrrp3` - VRRPv3 * `carp` - CARP * `clusterxl` - ClusterXL * `hsrp` - HSRP * `glbp` - GLBP * `other` - Other
20    #[serde(rename = "protocol")]
21    pub protocol: Protocol,
22    #[serde(rename = "group_id")]
23    pub group_id: i32,
24    /// * `plaintext` - Plaintext * `md5` - MD5
25    #[serde(
26        rename = "auth_type",
27        default,
28        with = "::serde_with::rust::double_option",
29        skip_serializing_if = "Option::is_none"
30    )]
31    pub auth_type: Option<Option<AuthType>>,
32    #[serde(rename = "auth_key", skip_serializing_if = "Option::is_none")]
33    pub auth_key: Option<String>,
34    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
35    pub description: Option<String>,
36    #[serde(
37        rename = "owner",
38        default,
39        with = "::serde_with::rust::double_option",
40        skip_serializing_if = "Option::is_none"
41    )]
42    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
43    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
44    pub comments: Option<String>,
45    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
46    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
47    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
48    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
49}
50
51impl BulkFhrpGroupRequest {
52    /// Base serializer class for models inheriting from PrimaryModel.
53    pub fn new(id: i32, protocol: Protocol, group_id: i32) -> BulkFhrpGroupRequest {
54        BulkFhrpGroupRequest {
55            id,
56            name: None,
57            protocol,
58            group_id,
59            auth_type: None,
60            auth_key: None,
61            description: None,
62            owner: None,
63            comments: None,
64            tags: None,
65            custom_fields: None,
66        }
67    }
68}
69
70/// * `vrrp2` - VRRPv2 * `vrrp3` - VRRPv3 * `carp` - CARP * `clusterxl` - ClusterXL * `hsrp` - HSRP * `glbp` - GLBP * `other` - Other
71#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
72pub enum Protocol {
73    #[serde(rename = "vrrp2")]
74    Vrrp2,
75    #[serde(rename = "vrrp3")]
76    Vrrp3,
77    #[serde(rename = "carp")]
78    Carp,
79    #[serde(rename = "clusterxl")]
80    Clusterxl,
81    #[serde(rename = "hsrp")]
82    Hsrp,
83    #[serde(rename = "glbp")]
84    Glbp,
85    #[serde(rename = "other")]
86    Other,
87}
88
89impl Default for Protocol {
90    fn default() -> Protocol {
91        Self::Vrrp2
92    }
93}
94/// * `plaintext` - Plaintext * `md5` - MD5
95#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
96pub enum AuthType {
97    #[serde(rename = "plaintext")]
98    Plaintext,
99    #[serde(rename = "md5")]
100    Md5,
101    #[serde(rename = "")]
102    Empty,
103    #[serde(rename = "null")]
104    Null,
105}
106
107impl Default for AuthType {
108    fn default() -> AuthType {
109        Self::Plaintext
110    }
111}