Skip to main content

netbox_openapi/models/
bulk_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.6.8 (4.6)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// BulkIkeProposalRequest : Base serializer class for models inheriting from PrimaryModel.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct BulkIkeProposalRequest {
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    /// * `preshared-keys` - Pre-shared keys * `certificates` - Certificates * `rsa-signatures` - RSA signatures * `dsa-signatures` - DSA signatures
22    #[serde(rename = "authentication_method")]
23    pub authentication_method: AuthenticationMethod,
24    /// * `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
25    #[serde(rename = "encryption_algorithm")]
26    pub encryption_algorithm: 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    /// * `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
34    #[serde(rename = "group")]
35    pub group: i32,
36    /// Security association lifetime (in seconds)
37    #[serde(
38        rename = "sa_lifetime",
39        default,
40        with = "::serde_with::rust::double_option",
41        skip_serializing_if = "Option::is_none"
42    )]
43    pub sa_lifetime: Option<Option<i32>>,
44    #[serde(
45        rename = "owner",
46        default,
47        with = "::serde_with::rust::double_option",
48        skip_serializing_if = "Option::is_none"
49    )]
50    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
51    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
52    pub comments: Option<String>,
53    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
54    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
55    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
56    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
57}
58
59impl BulkIkeProposalRequest {
60    /// Base serializer class for models inheriting from PrimaryModel.
61    pub fn new(
62        id: i32,
63        name: String,
64        authentication_method: AuthenticationMethod,
65        encryption_algorithm: EncryptionAlgorithm,
66        group: i32,
67    ) -> BulkIkeProposalRequest {
68        BulkIkeProposalRequest {
69            id,
70            name,
71            description: None,
72            authentication_method,
73            encryption_algorithm,
74            authentication_algorithm: None,
75            group,
76            sa_lifetime: None,
77            owner: None,
78            comments: None,
79            tags: None,
80            custom_fields: None,
81        }
82    }
83}
84
85/// * `preshared-keys` - Pre-shared keys * `certificates` - Certificates * `rsa-signatures` - RSA signatures * `dsa-signatures` - DSA signatures
86#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
87pub enum AuthenticationMethod {
88    #[serde(rename = "preshared-keys")]
89    PresharedKeys,
90    #[serde(rename = "certificates")]
91    Certificates,
92    #[serde(rename = "rsa-signatures")]
93    RsaSignatures,
94    #[serde(rename = "dsa-signatures")]
95    DsaSignatures,
96}
97
98impl Default for AuthenticationMethod {
99    fn default() -> AuthenticationMethod {
100        Self::PresharedKeys
101    }
102}
103/// * `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
104#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
105pub enum EncryptionAlgorithm {
106    #[serde(rename = "aes-128-cbc")]
107    Aes128Cbc,
108    #[serde(rename = "aes-128-gcm")]
109    Aes128Gcm,
110    #[serde(rename = "aes-192-cbc")]
111    Aes192Cbc,
112    #[serde(rename = "aes-192-gcm")]
113    Aes192Gcm,
114    #[serde(rename = "aes-256-cbc")]
115    Aes256Cbc,
116    #[serde(rename = "aes-256-gcm")]
117    Aes256Gcm,
118    #[serde(rename = "3des-cbc")]
119    Variant3desCbc,
120    #[serde(rename = "des-cbc")]
121    DesCbc,
122}
123
124impl Default for EncryptionAlgorithm {
125    fn default() -> EncryptionAlgorithm {
126        Self::Aes128Cbc
127    }
128}
129/// * `hmac-sha1` - SHA-1 HMAC * `hmac-sha256` - SHA-256 HMAC * `hmac-sha384` - SHA-384 HMAC * `hmac-sha512` - SHA-512 HMAC * `hmac-md5` - MD5 HMAC
130#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
131pub enum AuthenticationAlgorithm {
132    #[serde(rename = "hmac-sha1")]
133    Sha1,
134    #[serde(rename = "hmac-sha256")]
135    Sha256,
136    #[serde(rename = "hmac-sha384")]
137    Sha384,
138    #[serde(rename = "hmac-sha512")]
139    Sha512,
140    #[serde(rename = "hmac-md5")]
141    Md5,
142}
143
144impl Default for AuthenticationAlgorithm {
145    fn default() -> AuthenticationAlgorithm {
146        Self::Sha1
147    }
148}