Skip to main content

netbox_openapi/models/
ike_proposal_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.0 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// IkeProposalRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct IkeProposalRequest {
15    #[serde(rename = "name")]
16    pub name: String,
17    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
18    pub description: Option<String>,
19    /// * `preshared-keys` - Pre-shared keys * `certificates` - Certificates * `rsa-signatures` - RSA signatures * `dsa-signatures` - DSA signatures
20    #[serde(rename = "authentication_method")]
21    pub authentication_method: AuthenticationMethod,
22    /// * `aes-128-cbc` - 128-bit AES (CBC) * `aes-128-gcm` - 128-bit AES (GCM) * `aes-192-cbc` - 192-bit AES (CBC) * `aes-192-gcm` - 192-bit AES (GCM) * `aes-256-cbc` - 256-bit AES (CBC) * `aes-256-gcm` - 256-bit AES (GCM) * `3des-cbc` - 3DES * `des-cbc` - DES
23    #[serde(rename = "encryption_algorithm")]
24    pub encryption_algorithm: EncryptionAlgorithm,
25    /// * `hmac-sha1` - SHA-1 HMAC * `hmac-sha256` - SHA-256 HMAC * `hmac-sha384` - SHA-384 HMAC * `hmac-sha512` - SHA-512 HMAC * `hmac-md5` - MD5 HMAC
26    #[serde(
27        rename = "authentication_algorithm",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub authentication_algorithm: Option<AuthenticationAlgorithm>,
31    /// * `1` - Group 1 * `2` - Group 2 * `5` - Group 5 * `14` - Group 14 * `15` - Group 15 * `16` - Group 16 * `17` - Group 17 * `18` - Group 18 * `19` - Group 19 * `20` - Group 20 * `21` - Group 21 * `22` - Group 22 * `23` - Group 23 * `24` - Group 24 * `25` - Group 25 * `26` - Group 26 * `27` - Group 27 * `28` - Group 28 * `29` - Group 29 * `30` - Group 30 * `31` - Group 31 * `32` - Group 32 * `33` - Group 33 * `34` - Group 34
32    #[serde(rename = "group")]
33    pub group: i32,
34    /// Security association lifetime (in seconds)
35    #[serde(
36        rename = "sa_lifetime",
37        default,
38        with = "::serde_with::rust::double_option",
39        skip_serializing_if = "Option::is_none"
40    )]
41    pub sa_lifetime: Option<Option<i32>>,
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::AsnRangeRequestOwner>>>,
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::NestedTagRequest>>,
53    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
54    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
55}
56
57impl IkeProposalRequest {
58    /// Base serializer class for models inheriting from PrimaryModel.
59    pub fn new(
60        name: String,
61        authentication_method: AuthenticationMethod,
62        encryption_algorithm: EncryptionAlgorithm,
63        group: i32,
64    ) -> IkeProposalRequest {
65        IkeProposalRequest {
66            name,
67            description: None,
68            authentication_method,
69            encryption_algorithm,
70            authentication_algorithm: None,
71            group,
72            sa_lifetime: None,
73            owner: None,
74            comments: None,
75            tags: None,
76            custom_fields: None,
77        }
78    }
79}
80
81/// * `preshared-keys` - Pre-shared keys * `certificates` - Certificates * `rsa-signatures` - RSA signatures * `dsa-signatures` - DSA signatures
82#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
83pub enum AuthenticationMethod {
84    #[serde(rename = "preshared-keys")]
85    PresharedKeys,
86    #[serde(rename = "certificates")]
87    Certificates,
88    #[serde(rename = "rsa-signatures")]
89    RsaSignatures,
90    #[serde(rename = "dsa-signatures")]
91    DsaSignatures,
92}
93
94impl Default for AuthenticationMethod {
95    fn default() -> AuthenticationMethod {
96        Self::PresharedKeys
97    }
98}
99/// * `aes-128-cbc` - 128-bit AES (CBC) * `aes-128-gcm` - 128-bit AES (GCM) * `aes-192-cbc` - 192-bit AES (CBC) * `aes-192-gcm` - 192-bit AES (GCM) * `aes-256-cbc` - 256-bit AES (CBC) * `aes-256-gcm` - 256-bit AES (GCM) * `3des-cbc` - 3DES * `des-cbc` - DES
100#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
101pub enum EncryptionAlgorithm {
102    #[serde(rename = "aes-128-cbc")]
103    Aes128Cbc,
104    #[serde(rename = "aes-128-gcm")]
105    Aes128Gcm,
106    #[serde(rename = "aes-192-cbc")]
107    Aes192Cbc,
108    #[serde(rename = "aes-192-gcm")]
109    Aes192Gcm,
110    #[serde(rename = "aes-256-cbc")]
111    Aes256Cbc,
112    #[serde(rename = "aes-256-gcm")]
113    Aes256Gcm,
114    #[serde(rename = "3des-cbc")]
115    Variant3desCbc,
116    #[serde(rename = "des-cbc")]
117    DesCbc,
118}
119
120impl Default for EncryptionAlgorithm {
121    fn default() -> EncryptionAlgorithm {
122        Self::Aes128Cbc
123    }
124}
125/// * `hmac-sha1` - SHA-1 HMAC * `hmac-sha256` - SHA-256 HMAC * `hmac-sha384` - SHA-384 HMAC * `hmac-sha512` - SHA-512 HMAC * `hmac-md5` - MD5 HMAC
126#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
127pub enum AuthenticationAlgorithm {
128    #[serde(rename = "hmac-sha1")]
129    Sha1,
130    #[serde(rename = "hmac-sha256")]
131    Sha256,
132    #[serde(rename = "hmac-sha384")]
133    Sha384,
134    #[serde(rename = "hmac-sha512")]
135    Sha512,
136    #[serde(rename = "hmac-md5")]
137    Md5,
138}
139
140impl Default for AuthenticationAlgorithm {
141    fn default() -> AuthenticationAlgorithm {
142        Self::Sha1
143    }
144}