Skip to main content

netbox_openapi/models/
bulk_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.6.8 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// BulkIpSecProposalRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct BulkIpSecProposalRequest {
15    #[serde(rename = "id")]
16    pub id: i32,
17    #[serde(rename = "name")]
18    pub name: String,
19    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
20    pub description: Option<String>,
21    /// * `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
22    #[serde(
23        rename = "encryption_algorithm",
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub encryption_algorithm: Option<EncryptionAlgorithm>,
27    /// * `hmac-sha1` - SHA-1 HMAC * `hmac-sha256` - SHA-256 HMAC * `hmac-sha384` - SHA-384 HMAC * `hmac-sha512` - SHA-512 HMAC * `hmac-md5` - MD5 HMAC
28    #[serde(
29        rename = "authentication_algorithm",
30        skip_serializing_if = "Option::is_none"
31    )]
32    pub authentication_algorithm: 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 BulkIpSecProposalRequest {
65    /// Base serializer class for models inheriting from PrimaryModel.
66    pub fn new(id: i32, name: String) -> BulkIpSecProposalRequest {
67        BulkIpSecProposalRequest {
68            id,
69            name,
70            description: None,
71            encryption_algorithm: None,
72            authentication_algorithm: None,
73            sa_lifetime_seconds: None,
74            sa_lifetime_data: None,
75            owner: None,
76            comments: None,
77            tags: None,
78            custom_fields: None,
79        }
80    }
81}
82
83/// * `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
84#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
85pub enum EncryptionAlgorithm {
86    #[serde(rename = "aes-128-cbc")]
87    Aes128Cbc,
88    #[serde(rename = "aes-128-gcm")]
89    Aes128Gcm,
90    #[serde(rename = "aes-192-cbc")]
91    Aes192Cbc,
92    #[serde(rename = "aes-192-gcm")]
93    Aes192Gcm,
94    #[serde(rename = "aes-256-cbc")]
95    Aes256Cbc,
96    #[serde(rename = "aes-256-gcm")]
97    Aes256Gcm,
98    #[serde(rename = "3des-cbc")]
99    Variant3desCbc,
100    #[serde(rename = "des-cbc")]
101    DesCbc,
102}
103
104impl Default for EncryptionAlgorithm {
105    fn default() -> EncryptionAlgorithm {
106        Self::Aes128Cbc
107    }
108}
109/// * `hmac-sha1` - SHA-1 HMAC * `hmac-sha256` - SHA-256 HMAC * `hmac-sha384` - SHA-384 HMAC * `hmac-sha512` - SHA-512 HMAC * `hmac-md5` - MD5 HMAC
110#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
111pub enum AuthenticationAlgorithm {
112    #[serde(rename = "hmac-sha1")]
113    Sha1,
114    #[serde(rename = "hmac-sha256")]
115    Sha256,
116    #[serde(rename = "hmac-sha384")]
117    Sha384,
118    #[serde(rename = "hmac-sha512")]
119    Sha512,
120    #[serde(rename = "hmac-md5")]
121    Md5,
122}
123
124impl Default for AuthenticationAlgorithm {
125    fn default() -> AuthenticationAlgorithm {
126        Self::Sha1
127    }
128}