Skip to main content

netbox_openapi/models/
vpn_ike_proposals_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 VpnIkeProposalsCreateRequest {
13    #[serde(rename = "name")]
14    pub name: String,
15    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
16    pub description: Option<String>,
17    /// * `preshared-keys` - Pre-shared keys * `certificates` - Certificates * `rsa-signatures` - RSA signatures * `dsa-signatures` - DSA signatures
18    #[serde(rename = "authentication_method")]
19    pub authentication_method: AuthenticationMethod,
20    /// * `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
21    #[serde(rename = "encryption_algorithm")]
22    pub encryption_algorithm: EncryptionAlgorithm,
23    /// * `hmac-sha1` - SHA-1 HMAC * `hmac-sha256` - SHA-256 HMAC * `hmac-sha384` - SHA-384 HMAC * `hmac-sha512` - SHA-512 HMAC * `hmac-md5` - MD5 HMAC
24    #[serde(
25        rename = "authentication_algorithm",
26        default,
27        with = "::serde_with::rust::double_option",
28        skip_serializing_if = "Option::is_none"
29    )]
30    pub authentication_algorithm: Option<Option<AuthenticationAlgorithm>>,
31    /// 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
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 VpnIkeProposalsCreateRequest {
58    pub fn new(
59        name: String,
60        authentication_method: AuthenticationMethod,
61        encryption_algorithm: EncryptionAlgorithm,
62        group: i32,
63    ) -> VpnIkeProposalsCreateRequest {
64        VpnIkeProposalsCreateRequest {
65            name,
66            description: None,
67            authentication_method,
68            encryption_algorithm,
69            authentication_algorithm: None,
70            group,
71            sa_lifetime: None,
72            owner: None,
73            comments: None,
74            tags: None,
75            custom_fields: None,
76        }
77    }
78}
79
80/// * `preshared-keys` - Pre-shared keys * `certificates` - Certificates * `rsa-signatures` - RSA signatures * `dsa-signatures` - DSA signatures
81#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
82pub enum AuthenticationMethod {
83    #[serde(rename = "preshared-keys")]
84    PresharedKeys,
85    #[serde(rename = "certificates")]
86    Certificates,
87    #[serde(rename = "rsa-signatures")]
88    RsaSignatures,
89    #[serde(rename = "dsa-signatures")]
90    DsaSignatures,
91}
92
93impl Default for AuthenticationMethod {
94    fn default() -> AuthenticationMethod {
95        Self::PresharedKeys
96    }
97}
98/// * `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
99#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
100pub enum EncryptionAlgorithm {
101    #[serde(rename = "aes-128-cbc")]
102    Aes128Cbc,
103    #[serde(rename = "aes-128-gcm")]
104    Aes128Gcm,
105    #[serde(rename = "aes-192-cbc")]
106    Aes192Cbc,
107    #[serde(rename = "aes-192-gcm")]
108    Aes192Gcm,
109    #[serde(rename = "aes-256-cbc")]
110    Aes256Cbc,
111    #[serde(rename = "aes-256-gcm")]
112    Aes256Gcm,
113    #[serde(rename = "3des-cbc")]
114    Variant3desCbc,
115    #[serde(rename = "des-cbc")]
116    DesCbc,
117}
118
119impl Default for EncryptionAlgorithm {
120    fn default() -> EncryptionAlgorithm {
121        Self::Aes128Cbc
122    }
123}
124/// * `hmac-sha1` - SHA-1 HMAC * `hmac-sha256` - SHA-256 HMAC * `hmac-sha384` - SHA-384 HMAC * `hmac-sha512` - SHA-512 HMAC * `hmac-md5` - MD5 HMAC
125#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
126pub enum AuthenticationAlgorithm {
127    #[serde(rename = "hmac-sha1")]
128    HmacSha1,
129    #[serde(rename = "hmac-sha256")]
130    HmacSha256,
131    #[serde(rename = "hmac-sha384")]
132    HmacSha384,
133    #[serde(rename = "hmac-sha512")]
134    HmacSha512,
135    #[serde(rename = "hmac-md5")]
136    HmacMd5,
137    #[serde(rename = "")]
138    Empty,
139    #[serde(rename = "null")]
140    Null,
141}
142
143impl Default for AuthenticationAlgorithm {
144    fn default() -> AuthenticationAlgorithm {
145        Self::HmacSha1
146    }
147}