Skip to main content

netbox_openapi/models/
vpn_ipsec_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 VpnIpsecProposalsCreateRequest {
13    #[serde(rename = "name")]
14    pub name: String,
15    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
16    pub description: Option<String>,
17    /// * `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
18    #[serde(
19        rename = "encryption_algorithm",
20        default,
21        with = "::serde_with::rust::double_option",
22        skip_serializing_if = "Option::is_none"
23    )]
24    pub encryption_algorithm: Option<Option<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    /// Security association lifetime (seconds)
34    #[serde(
35        rename = "sa_lifetime_seconds",
36        default,
37        with = "::serde_with::rust::double_option",
38        skip_serializing_if = "Option::is_none"
39    )]
40    pub sa_lifetime_seconds: Option<Option<i32>>,
41    /// Security association lifetime (in kilobytes)
42    #[serde(
43        rename = "sa_lifetime_data",
44        default,
45        with = "::serde_with::rust::double_option",
46        skip_serializing_if = "Option::is_none"
47    )]
48    pub sa_lifetime_data: Option<Option<i32>>,
49    #[serde(
50        rename = "owner",
51        default,
52        with = "::serde_with::rust::double_option",
53        skip_serializing_if = "Option::is_none"
54    )]
55    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
56    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
57    pub comments: Option<String>,
58    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
59    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
60    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
61    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
62}
63
64impl VpnIpsecProposalsCreateRequest {
65    pub fn new(name: String) -> VpnIpsecProposalsCreateRequest {
66        VpnIpsecProposalsCreateRequest {
67            name,
68            description: None,
69            encryption_algorithm: None,
70            authentication_algorithm: None,
71            sa_lifetime_seconds: None,
72            sa_lifetime_data: None,
73            owner: None,
74            comments: None,
75            tags: None,
76            custom_fields: None,
77        }
78    }
79}
80
81/// * `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
82#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
83pub enum EncryptionAlgorithm {
84    #[serde(rename = "aes-128-cbc")]
85    Aes128Cbc,
86    #[serde(rename = "aes-128-gcm")]
87    Aes128Gcm,
88    #[serde(rename = "aes-192-cbc")]
89    Aes192Cbc,
90    #[serde(rename = "aes-192-gcm")]
91    Aes192Gcm,
92    #[serde(rename = "aes-256-cbc")]
93    Aes256Cbc,
94    #[serde(rename = "aes-256-gcm")]
95    Aes256Gcm,
96    #[serde(rename = "3des-cbc")]
97    Variant3desCbc,
98    #[serde(rename = "des-cbc")]
99    DesCbc,
100    #[serde(rename = "")]
101    Empty,
102    #[serde(rename = "null")]
103    Null,
104}
105
106impl Default for EncryptionAlgorithm {
107    fn default() -> EncryptionAlgorithm {
108        Self::Aes128Cbc
109    }
110}
111/// * `hmac-sha1` - SHA-1 HMAC * `hmac-sha256` - SHA-256 HMAC * `hmac-sha384` - SHA-384 HMAC * `hmac-sha512` - SHA-512 HMAC * `hmac-md5` - MD5 HMAC
112#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
113pub enum AuthenticationAlgorithm {
114    #[serde(rename = "hmac-sha1")]
115    HmacSha1,
116    #[serde(rename = "hmac-sha256")]
117    HmacSha256,
118    #[serde(rename = "hmac-sha384")]
119    HmacSha384,
120    #[serde(rename = "hmac-sha512")]
121    HmacSha512,
122    #[serde(rename = "hmac-md5")]
123    HmacMd5,
124    #[serde(rename = "")]
125    Empty,
126    #[serde(rename = "null")]
127    Null,
128}
129
130impl Default for AuthenticationAlgorithm {
131    fn default() -> AuthenticationAlgorithm {
132        Self::HmacSha1
133    }
134}