Skip to main content

netbox_openapi/models/
writable_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/// WritableIkeProposalRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct WritableIkeProposalRequest {
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        default,
29        with = "::serde_with::rust::double_option",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub authentication_algorithm: Option<Option<AuthenticationAlgorithm>>,
33    /// Diffie-Hellman group ID  * `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
34    #[serde(rename = "group")]
35    pub group: i32,
36    /// Security association lifetime (in seconds)
37    #[serde(
38        rename = "sa_lifetime",
39        default,
40        with = "::serde_with::rust::double_option",
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub sa_lifetime: Option<Option<i32>>,
44    #[serde(
45        rename = "owner",
46        default,
47        with = "::serde_with::rust::double_option",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
51    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
52    pub comments: Option<String>,
53    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
54    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
55    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
56    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
57}
58
59impl WritableIkeProposalRequest {
60    /// Base serializer class for models inheriting from PrimaryModel.
61    pub fn new(
62        name: String,
63        authentication_method: AuthenticationMethod,
64        encryption_algorithm: EncryptionAlgorithm,
65        group: i32,
66    ) -> WritableIkeProposalRequest {
67        WritableIkeProposalRequest {
68            name,
69            description: None,
70            authentication_method,
71            encryption_algorithm,
72            authentication_algorithm: None,
73            group,
74            sa_lifetime: None,
75            owner: None,
76            comments: None,
77            tags: None,
78            custom_fields: None,
79        }
80    }
81}
82
83/// * `preshared-keys` - Pre-shared keys * `certificates` - Certificates * `rsa-signatures` - RSA signatures * `dsa-signatures` - DSA signatures
84#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
85pub enum AuthenticationMethod {
86    #[serde(rename = "preshared-keys")]
87    PresharedKeys,
88    #[serde(rename = "certificates")]
89    Certificates,
90    #[serde(rename = "rsa-signatures")]
91    RsaSignatures,
92    #[serde(rename = "dsa-signatures")]
93    DsaSignatures,
94}
95
96impl Default for AuthenticationMethod {
97    fn default() -> AuthenticationMethod {
98        Self::PresharedKeys
99    }
100}
101/// * `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
102#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
103pub enum EncryptionAlgorithm {
104    #[serde(rename = "aes-128-cbc")]
105    Aes128Cbc,
106    #[serde(rename = "aes-128-gcm")]
107    Aes128Gcm,
108    #[serde(rename = "aes-192-cbc")]
109    Aes192Cbc,
110    #[serde(rename = "aes-192-gcm")]
111    Aes192Gcm,
112    #[serde(rename = "aes-256-cbc")]
113    Aes256Cbc,
114    #[serde(rename = "aes-256-gcm")]
115    Aes256Gcm,
116    #[serde(rename = "3des-cbc")]
117    Variant3desCbc,
118    #[serde(rename = "des-cbc")]
119    DesCbc,
120}
121
122impl Default for EncryptionAlgorithm {
123    fn default() -> EncryptionAlgorithm {
124        Self::Aes128Cbc
125    }
126}
127/// * `hmac-sha1` - SHA-1 HMAC * `hmac-sha256` - SHA-256 HMAC * `hmac-sha384` - SHA-384 HMAC * `hmac-sha512` - SHA-512 HMAC * `hmac-md5` - MD5 HMAC
128#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
129pub enum AuthenticationAlgorithm {
130    #[serde(rename = "hmac-sha1")]
131    HmacSha1,
132    #[serde(rename = "hmac-sha256")]
133    HmacSha256,
134    #[serde(rename = "hmac-sha384")]
135    HmacSha384,
136    #[serde(rename = "hmac-sha512")]
137    HmacSha512,
138    #[serde(rename = "hmac-md5")]
139    HmacMd5,
140    #[serde(rename = "")]
141    Empty,
142    #[serde(rename = "null")]
143    Null,
144}
145
146impl Default for AuthenticationAlgorithm {
147    fn default() -> AuthenticationAlgorithm {
148        Self::HmacSha1
149    }
150}