netbox_openapi/models/
ip_sec_proposal_request.rs1#[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 #[serde(
21 rename = "encryption_algorithm",
22 skip_serializing_if = "Option::is_none"
23 )]
24 pub encryption_algorithm: Option<EncryptionAlgorithm>,
25 #[serde(
27 rename = "authentication_algorithm",
28 skip_serializing_if = "Option::is_none"
29 )]
30 pub authentication_algorithm: Option<AuthenticationAlgorithm>,
31 #[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 #[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(rename = "comments", skip_serializing_if = "Option::is_none")]
48 pub comments: Option<String>,
49 #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
50 pub tags: Option<Vec<crate::models::NestedTagRequest>>,
51 #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
52 pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
53}
54
55impl IpSecProposalRequest {
56 pub fn new(name: String) -> IpSecProposalRequest {
58 IpSecProposalRequest {
59 name,
60 description: None,
61 encryption_algorithm: None,
62 authentication_algorithm: None,
63 sa_lifetime_seconds: None,
64 sa_lifetime_data: None,
65 comments: None,
66 tags: None,
67 custom_fields: None,
68 }
69 }
70}
71
72#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
74pub enum EncryptionAlgorithm {
75 #[serde(rename = "aes-128-cbc")]
76 Aes128Cbc,
77 #[serde(rename = "aes-128-gcm")]
78 Aes128Gcm,
79 #[serde(rename = "aes-192-cbc")]
80 Aes192Cbc,
81 #[serde(rename = "aes-192-gcm")]
82 Aes192Gcm,
83 #[serde(rename = "aes-256-cbc")]
84 Aes256Cbc,
85 #[serde(rename = "aes-256-gcm")]
86 Aes256Gcm,
87 #[serde(rename = "3des-cbc")]
88 Variant3desCbc,
89 #[serde(rename = "des-cbc")]
90 DesCbc,
91}
92
93impl Default for EncryptionAlgorithm {
94 fn default() -> EncryptionAlgorithm {
95 Self::Aes128Cbc
96 }
97}
98#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
100pub enum AuthenticationAlgorithm {
101 #[serde(rename = "hmac-sha1")]
102 Sha1,
103 #[serde(rename = "hmac-sha256")]
104 Sha256,
105 #[serde(rename = "hmac-sha384")]
106 Sha384,
107 #[serde(rename = "hmac-sha512")]
108 Sha512,
109 #[serde(rename = "hmac-md5")]
110 Md5,
111}
112
113impl Default for AuthenticationAlgorithm {
114 fn default() -> AuthenticationAlgorithm {
115 Self::Sha1
116 }
117}