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
                                      */

use crate::google_rest_apis::compute_v1::models;

/// FirewallPolicyRuleMatcher : Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FirewallPolicyRuleMatcher {
    /// Address groups which should be matched against the traffic destination. Maximum number of destination address groups is 10.
    #[serde(rename = "destAddressGroups", skip_serializing_if = "Option::is_none")]
    pub dest_address_groups: Option<Vec<String>>,
    /// Fully Qualified Domain Name (FQDN) which should be matched against traffic destination. Maximum number of destination fqdn allowed is 100.
    #[serde(rename = "destFqdns", skip_serializing_if = "Option::is_none")]
    pub dest_fqdns: Option<Vec<String>>,
    /// CIDR IP address range. Maximum number of destination CIDR IP ranges allowed is 5000.
    #[serde(rename = "destIpRanges", skip_serializing_if = "Option::is_none")]
    pub dest_ip_ranges: Option<Vec<String>>,
    /// Region codes whose IP addresses will be used to match for destination of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex.\"US\" Maximum number of dest region codes allowed is 5000.
    #[serde(rename = "destRegionCodes", skip_serializing_if = "Option::is_none")]
    pub dest_region_codes: Option<Vec<String>>,
    /// Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic destination.
    #[serde(
        rename = "destThreatIntelligences",
        skip_serializing_if = "Option::is_none"
    )]
    pub dest_threat_intelligences: Option<Vec<String>>,
    /// Pairs of IP protocols and ports that the rule should match.
    #[serde(rename = "layer4Configs", skip_serializing_if = "Option::is_none")]
    pub layer4_configs: Option<Vec<models::FirewallPolicyRuleMatcherLayer4Config>>,
    /// Address groups which should be matched against the traffic source. Maximum number of source address groups is 10.
    #[serde(rename = "srcAddressGroups", skip_serializing_if = "Option::is_none")]
    pub src_address_groups: Option<Vec<String>>,
    /// Fully Qualified Domain Name (FQDN) which should be matched against traffic source. Maximum number of source fqdn allowed is 100.
    #[serde(rename = "srcFqdns", skip_serializing_if = "Option::is_none")]
    pub src_fqdns: Option<Vec<String>>,
    /// CIDR IP address range. Maximum number of source CIDR IP ranges allowed is 5000.
    #[serde(rename = "srcIpRanges", skip_serializing_if = "Option::is_none")]
    pub src_ip_ranges: Option<Vec<String>>,
    /// Region codes whose IP addresses will be used to match for source of traffic. Should be specified as 2 letter country code defined as per ISO 3166 alpha-2 country codes. ex.\"US\" Maximum number of source region codes allowed is 5000.
    #[serde(rename = "srcRegionCodes", skip_serializing_if = "Option::is_none")]
    pub src_region_codes: Option<Vec<String>>,
    /// List of secure tag values, which should be matched at the source of the traffic. For INGRESS rule, if all the srcSecureTag are INEFFECTIVE, and there is no srcIpRange, this rule will be ignored. Maximum number of source tag values allowed is 256.
    #[serde(rename = "srcSecureTags", skip_serializing_if = "Option::is_none")]
    pub src_secure_tags: Option<Vec<models::FirewallPolicyRuleSecureTag>>,
    /// Names of Network Threat Intelligence lists. The IPs in these lists will be matched against traffic source.
    #[serde(
        rename = "srcThreatIntelligences",
        skip_serializing_if = "Option::is_none"
    )]
    pub src_threat_intelligences: Option<Vec<String>>,
}

impl FirewallPolicyRuleMatcher {
    /// Represents a match condition that incoming traffic is evaluated against. Exactly one field must be specified.
    pub fn new() -> FirewallPolicyRuleMatcher {
        FirewallPolicyRuleMatcher {
            dest_address_groups: None,
            dest_fqdns: None,
            dest_ip_ranges: None,
            dest_region_codes: None,
            dest_threat_intelligences: None,
            layer4_configs: None,
            src_address_groups: None,
            src_fqdns: None,
            src_ip_ranges: None,
            src_region_codes: None,
            src_secure_tags: None,
            src_threat_intelligences: None,
        }
    }
}
