netbox-openapi 0.6.0

low level netbox bindings (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * NetBox REST API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 4.6.2 (4.6)
 *
 * Generated by: https://openapi-generator.tech
 */

/// WritableIkeProposalRequest : Base serializer class for models inheriting from PrimaryModel.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct WritableIkeProposalRequest {
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// * `preshared-keys` - Pre-shared keys * `certificates` - Certificates * `rsa-signatures` - RSA signatures * `dsa-signatures` - DSA signatures
    #[serde(rename = "authentication_method")]
    pub authentication_method: AuthenticationMethod,
    /// * `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
    #[serde(rename = "encryption_algorithm")]
    pub encryption_algorithm: EncryptionAlgorithm,
    /// * `hmac-sha1` - SHA-1 HMAC * `hmac-sha256` - SHA-256 HMAC * `hmac-sha384` - SHA-384 HMAC * `hmac-sha512` - SHA-512 HMAC * `hmac-md5` - MD5 HMAC
    #[serde(
        rename = "authentication_algorithm",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub authentication_algorithm: Option<Option<AuthenticationAlgorithm>>,
    /// Diffie-Hellman group ID  * `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
    #[serde(rename = "group")]
    pub group: i32,
    /// Security association lifetime (in seconds)
    #[serde(
        rename = "sa_lifetime",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub sa_lifetime: Option<Option<i32>>,
    #[serde(
        rename = "owner",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub owner: Option<Option<Box<crate::models::AsnRangeRequestOwner>>>,
    #[serde(rename = "comments", skip_serializing_if = "Option::is_none")]
    pub comments: Option<String>,
    #[serde(rename = "tags", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Vec<crate::models::NestedTagRequest>>,
    #[serde(rename = "custom_fields", skip_serializing_if = "Option::is_none")]
    pub custom_fields: Option<::std::collections::HashMap<String, serde_json::Value>>,
}

impl WritableIkeProposalRequest {
    /// Base serializer class for models inheriting from PrimaryModel.
    pub fn new(
        name: String,
        authentication_method: AuthenticationMethod,
        encryption_algorithm: EncryptionAlgorithm,
        group: i32,
    ) -> WritableIkeProposalRequest {
        WritableIkeProposalRequest {
            name,
            description: None,
            authentication_method,
            encryption_algorithm,
            authentication_algorithm: None,
            group,
            sa_lifetime: None,
            owner: None,
            comments: None,
            tags: None,
            custom_fields: None,
        }
    }
}

/// * `preshared-keys` - Pre-shared keys * `certificates` - Certificates * `rsa-signatures` - RSA signatures * `dsa-signatures` - DSA signatures
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AuthenticationMethod {
    #[serde(rename = "preshared-keys")]
    PresharedKeys,
    #[serde(rename = "certificates")]
    Certificates,
    #[serde(rename = "rsa-signatures")]
    RsaSignatures,
    #[serde(rename = "dsa-signatures")]
    DsaSignatures,
}

impl Default for AuthenticationMethod {
    fn default() -> AuthenticationMethod {
        Self::PresharedKeys
    }
}
/// * `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
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum EncryptionAlgorithm {
    #[serde(rename = "aes-128-cbc")]
    Aes128Cbc,
    #[serde(rename = "aes-128-gcm")]
    Aes128Gcm,
    #[serde(rename = "aes-192-cbc")]
    Aes192Cbc,
    #[serde(rename = "aes-192-gcm")]
    Aes192Gcm,
    #[serde(rename = "aes-256-cbc")]
    Aes256Cbc,
    #[serde(rename = "aes-256-gcm")]
    Aes256Gcm,
    #[serde(rename = "3des-cbc")]
    Variant3desCbc,
    #[serde(rename = "des-cbc")]
    DesCbc,
}

impl Default for EncryptionAlgorithm {
    fn default() -> EncryptionAlgorithm {
        Self::Aes128Cbc
    }
}
/// * `hmac-sha1` - SHA-1 HMAC * `hmac-sha256` - SHA-256 HMAC * `hmac-sha384` - SHA-384 HMAC * `hmac-sha512` - SHA-512 HMAC * `hmac-md5` - MD5 HMAC
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AuthenticationAlgorithm {
    #[serde(rename = "hmac-sha1")]
    HmacSha1,
    #[serde(rename = "hmac-sha256")]
    HmacSha256,
    #[serde(rename = "hmac-sha384")]
    HmacSha384,
    #[serde(rename = "hmac-sha512")]
    HmacSha512,
    #[serde(rename = "hmac-md5")]
    HmacMd5,
    #[serde(rename = "")]
    Empty,
    #[serde(rename = "null")]
    Null,
}

impl Default for AuthenticationAlgorithm {
    fn default() -> AuthenticationAlgorithm {
        Self::HmacSha1
    }
}