netbox_openapi/models/
writable_ip_sec_profile_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.4.2-Docker-3.4.1 (4.4)
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// WritableIpSecProfileRequest : Adds support for custom fields and tags.
12
13#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
14pub struct WritableIpSecProfileRequest {
15    #[serde(rename = "name")]
16    pub name: String,
17    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
18    pub description: Option<String>,
19    /// * `esp` - ESP * `ah` - AH
20    #[serde(rename = "mode")]
21    pub mode: Mode,
22    #[serde(rename = "ike_policy")]
23    pub ike_policy: Box<crate::models::IpSecProfileRequestIkePolicy>,
24    #[serde(rename = "ipsec_policy")]
25    pub ipsec_policy: Box<crate::models::IpSecProfileRequestIpsecPolicy>,
26    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
27    pub comments: Option<String>,
28    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
29    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
30    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
31    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
32}
33
34impl WritableIpSecProfileRequest {
35    /// Adds support for custom fields and tags.
36    pub fn new(
37        name: String,
38        mode: Mode,
39        ike_policy: crate::models::IpSecProfileRequestIkePolicy,
40        ipsec_policy: crate::models::IpSecProfileRequestIpsecPolicy,
41    ) -> WritableIpSecProfileRequest {
42        WritableIpSecProfileRequest {
43            name,
44            description: None,
45            mode,
46            ike_policy: Box::new(ike_policy),
47            ipsec_policy: Box::new(ipsec_policy),
48            comments: None,
49            tags: None,
50            custom_fields: None,
51        }
52    }
53}
54
55/// * `esp` - ESP * `ah` - AH
56#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
57pub enum Mode {
58    #[serde(rename = "esp")]
59    Esp,
60    #[serde(rename = "ah")]
61    Ah,
62}
63
64impl Default for Mode {
65    fn default() -> Mode {
66        Self::Esp
67    }
68}