Skip to main content

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