netbox_openapi/models/
ike_proposal_request.rs1#[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 #[serde(rename = "authentication_method")]
21 pub authentication_method: AuthenticationMethod,
22 #[serde(rename = "encryption_algorithm")]
24 pub encryption_algorithm: EncryptionAlgorithm,
25 #[serde(
27 rename = "authentication_algorithm",
28 skip_serializing_if = "Option::is_none"
29 )]
30 pub authentication_algorithm: Option<AuthenticationAlgorithm>,
31 #[serde(rename = "group")]
33 pub group: i32,
34 #[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 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#[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#[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#[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}