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.4.2-Docker-3.4.1 (4.4)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// IkeProposalRequest : Adds support for custom fields and tags.
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(rename = "comments", skip_serializing_if = "Option::is_none")]
43    pub comments: Option<String>,
44    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
45    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
46    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
47    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
48}
49
50impl IkeProposalRequest {
51    /// Adds support for custom fields and tags.
52    pub fn new(
53        name: String,
54        authentication_method: AuthenticationMethod,
55        encryption_algorithm: EncryptionAlgorithm,
56        group: i32,
57    ) -> IkeProposalRequest {
58        IkeProposalRequest {
59            name,
60            description: None,
61            authentication_method,
62            encryption_algorithm,
63            authentication_algorithm: None,
64            group,
65            sa_lifetime: None,
66            comments: None,
67            tags: None,
68            custom_fields: None,
69        }
70    }
71}
72
73/// * `preshared-keys` - Pre-shared keys * `certificates` - Certificates * `rsa-signatures` - RSA signatures * `dsa-signatures` - DSA signatures
74#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
75pub enum AuthenticationMethod {
76    #[serde(rename = "preshared-keys")]
77    PresharedKeys,
78    #[serde(rename = "certificates")]
79    Certificates,
80    #[serde(rename = "rsa-signatures")]
81    RsaSignatures,
82    #[serde(rename = "dsa-signatures")]
83    DsaSignatures,
84}
85
86impl Default for AuthenticationMethod {
87    fn default() -> AuthenticationMethod {
88        Self::PresharedKeys
89    }
90}
91/// * `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
92#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
93pub enum EncryptionAlgorithm {
94    #[serde(rename = "aes-128-cbc")]
95    Aes128Cbc,
96    #[serde(rename = "aes-128-gcm")]
97    Aes128Gcm,
98    #[serde(rename = "aes-192-cbc")]
99    Aes192Cbc,
100    #[serde(rename = "aes-192-gcm")]
101    Aes192Gcm,
102    #[serde(rename = "aes-256-cbc")]
103    Aes256Cbc,
104    #[serde(rename = "aes-256-gcm")]
105    Aes256Gcm,
106    #[serde(rename = "3des-cbc")]
107    Variant3desCbc,
108    #[serde(rename = "des-cbc")]
109    DesCbc,
110}
111
112impl Default for EncryptionAlgorithm {
113    fn default() -> EncryptionAlgorithm {
114        Self::Aes128Cbc
115    }
116}
117/// * `hmac-sha1` - SHA-1 HMAC * `hmac-sha256` - SHA-256 HMAC * `hmac-sha384` - SHA-384 HMAC * `hmac-sha512` - SHA-512 HMAC * `hmac-md5` - MD5 HMAC
118#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
119pub enum AuthenticationAlgorithm {
120    #[serde(rename = "hmac-sha1")]
121    Sha1,
122    #[serde(rename = "hmac-sha256")]
123    Sha256,
124    #[serde(rename = "hmac-sha384")]
125    Sha384,
126    #[serde(rename = "hmac-sha512")]
127    Sha512,
128    #[serde(rename = "hmac-md5")]
129    Md5,
130}
131
132impl Default for AuthenticationAlgorithm {
133    fn default() -> AuthenticationAlgorithm {
134        Self::Sha1
135    }
136}