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

/// SecurityPolicyRuleNetworkMatcher : Represents a match condition that incoming network traffic is evaluated against.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct SecurityPolicyRuleNetworkMatcher {
    /// Destination IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
    #[serde(rename = "destIpRanges", skip_serializing_if = "Option::is_none")]
    pub dest_ip_ranges: Option<Vec<String>>,
    /// Destination port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. \"80\") or range (e.g. \"0-1023\").
    #[serde(rename = "destPorts", skip_serializing_if = "Option::is_none")]
    pub dest_ports: Option<Vec<String>>,
    /// IPv4 protocol / IPv6 next header (after extension headers). Each element can be an 8-bit unsigned decimal number (e.g. \"6\"), range (e.g. \"253-254\"), or one of the following protocol names: \"tcp\", \"udp\", \"icmp\", \"esp\", \"ah\", \"ipip\", or \"sctp\".
    #[serde(rename = "ipProtocols", skip_serializing_if = "Option::is_none")]
    pub ip_protocols: Option<Vec<String>>,
    /// BGP Autonomous System Number associated with the source IP address.
    #[serde(rename = "srcAsns", skip_serializing_if = "Option::is_none")]
    pub src_asns: Option<Vec<i32>>,
    /// Source IPv4/IPv6 addresses or CIDR prefixes, in standard text format.
    #[serde(rename = "srcIpRanges", skip_serializing_if = "Option::is_none")]
    pub src_ip_ranges: Option<Vec<String>>,
    /// Source port numbers for TCP/UDP/SCTP. Each element can be a 16-bit unsigned decimal number (e.g. \"80\") or range (e.g. \"0-1023\").
    #[serde(rename = "srcPorts", skip_serializing_if = "Option::is_none")]
    pub src_ports: Option<Vec<String>>,
    /// Two-letter ISO 3166-1 alpha-2 country code associated with the source IP address.
    #[serde(rename = "srcRegionCodes", skip_serializing_if = "Option::is_none")]
    pub src_region_codes: Option<Vec<String>>,
    /// User-defined fields. Each element names a defined field and lists the matching values for that field.
    #[serde(rename = "userDefinedFields", skip_serializing_if = "Option::is_none")]
    pub user_defined_fields: Option<Vec<crate::google_rest_apis::compute_v1::models::SecurityPolicyRuleNetworkMatcherUserDefinedFieldMatch>>,
}

impl SecurityPolicyRuleNetworkMatcher {
    /// Represents a match condition that incoming network traffic is evaluated against.
    pub fn new() -> SecurityPolicyRuleNetworkMatcher {
        SecurityPolicyRuleNetworkMatcher {
            dest_ip_ranges: None,
            dest_ports: None,
            ip_protocols: None,
            src_asns: None,
            src_ip_ranges: None,
            src_ports: None,
            src_region_codes: None,
            user_defined_fields: None,
        }
    }
}
