use serde::{Deserialize, Serialize}; /*
                                      * Compute Engine API
                                      *
                                      * Creates and runs virtual machines on Google Cloud Platform.
                                      *
                                      * The version of the OpenAPI document: v1
                                      *
                                      * Generated by: https://openapi-generator.tech
                                      */

/// SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig : Configuration options for L7 DDoS detection. This field is only supported in Global Security Policies of type CLOUD_ARMOR.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig {
    /// If set to true, enables CAAP for L7 DDoS detection. This field is only supported in Global Security Policies of type CLOUD_ARMOR.
    #[serde(rename = "enable", skip_serializing_if = "Option::is_none")]
    pub enable: Option<bool>,
    /// Rule visibility can be one of the following: STANDARD - opaque rules. (default) PREMIUM - transparent rules. This field is only supported in Global Security Policies of type CLOUD_ARMOR.
    #[serde(rename = "ruleVisibility", skip_serializing_if = "Option::is_none")]
    pub rule_visibility: Option<RuleVisibility>,
    /// Configuration options for layer7 adaptive protection for various customizable thresholds.
    #[serde(rename = "thresholdConfigs", skip_serializing_if = "Option::is_none")]
    pub threshold_configs: Option<Vec<crate::google_rest_apis::compute_v1::models::SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfigThresholdConfig>>,
}

impl SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig {
    /// Configuration options for L7 DDoS detection. This field is only supported in Global Security Policies of type CLOUD_ARMOR.
    pub fn new() -> SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig {
        SecurityPolicyAdaptiveProtectionConfigLayer7DdosDefenseConfig {
            enable: None,
            rule_visibility: None,
            threshold_configs: None,
        }
    }
}

/// Rule visibility can be one of the following: STANDARD - opaque rules. (default) PREMIUM - transparent rules. This field is only supported in Global Security Policies of type CLOUD_ARMOR.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum RuleVisibility {
    #[serde(rename = "PREMIUM")]
    Premium,
    #[serde(rename = "STANDARD")]
    Standard,
}

impl Default for RuleVisibility {
    fn default() -> RuleVisibility {
        Self::Premium
    }
}
