Skip to main content

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