Skip to main content

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