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.4.2-Docker-3.4.1 (4.4)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// PatchedFhrpGroupRequest : Adds support for custom fields and tags.
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(rename = "comments", skip_serializing_if = "Option::is_none")]
35    pub comments: Option<String>,
36    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
37    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
38    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
39    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
40}
41
42impl PatchedFhrpGroupRequest {
43    /// Adds support for custom fields and tags.
44    pub fn new() -> PatchedFhrpGroupRequest {
45        PatchedFhrpGroupRequest {
46            name: None,
47            protocol: None,
48            group_id: None,
49            auth_type: None,
50            auth_key: None,
51            description: None,
52            comments: None,
53            tags: None,
54            custom_fields: None,
55        }
56    }
57}
58
59/// * `vrrp2` - VRRPv2 * `vrrp3` - VRRPv3 * `carp` - CARP * `clusterxl` - ClusterXL * `hsrp` - HSRP * `glbp` - GLBP * `other` - Other
60#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
61pub enum Protocol {
62    #[serde(rename = "vrrp2")]
63    Vrrp2,
64    #[serde(rename = "vrrp3")]
65    Vrrp3,
66    #[serde(rename = "carp")]
67    Carp,
68    #[serde(rename = "clusterxl")]
69    Clusterxl,
70    #[serde(rename = "hsrp")]
71    Hsrp,
72    #[serde(rename = "glbp")]
73    Glbp,
74    #[serde(rename = "other")]
75    Other,
76}
77
78impl Default for Protocol {
79    fn default() -> Protocol {
80        Self::Vrrp2
81    }
82}
83/// * `plaintext` - Plaintext * `md5` - MD5
84#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
85pub enum AuthType {
86    #[serde(rename = "plaintext")]
87    Plaintext,
88    #[serde(rename = "md5")]
89    Md5,
90    #[serde(rename = "")]
91    Empty,
92    #[serde(rename = "null")]
93    Null,
94}
95
96impl Default for AuthType {
97    fn default() -> AuthType {
98        Self::Plaintext
99    }
100}