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;

/// VmEndpointNatMappingsInterfaceNatMappings : Contain information of Nat mapping for an interface of this endpoint.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct VmEndpointNatMappingsInterfaceNatMappings {
    /// List of all drain IP:port-range mappings assigned to this interface. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: [\"2.2.2.2:12345-12355\", \"1.1.1.1:2234-2234\"].
    #[serde(
        rename = "drainNatIpPortRanges",
        skip_serializing_if = "Option::is_none"
    )]
    pub drain_nat_ip_port_ranges: Option<Vec<String>>,
    /// A list of all IP:port-range mappings assigned to this interface. These ranges are inclusive, that is, both the first and the last ports can be used for NAT. Example: [\"2.2.2.2:12345-12355\", \"1.1.1.1:2234-2234\"].
    #[serde(rename = "natIpPortRanges", skip_serializing_if = "Option::is_none")]
    pub nat_ip_port_ranges: Option<Vec<String>>,
    /// Total number of drain ports across all NAT IPs allocated to this interface. It equals to the aggregated port number in the field drain_nat_ip_port_ranges.
    #[serde(
        rename = "numTotalDrainNatPorts",
        skip_serializing_if = "Option::is_none"
    )]
    pub num_total_drain_nat_ports: Option<i32>,
    /// Total number of ports across all NAT IPs allocated to this interface. It equals to the aggregated port number in the field nat_ip_port_ranges.
    #[serde(rename = "numTotalNatPorts", skip_serializing_if = "Option::is_none")]
    pub num_total_nat_ports: Option<i32>,
    /// Information about mappings provided by rules in this NAT.
    #[serde(rename = "ruleMappings", skip_serializing_if = "Option::is_none")]
    pub rule_mappings:
        Option<Vec<models::VmEndpointNatMappingsInterfaceNatMappingsNatRuleMappings>>,
    /// Alias IP range for this interface endpoint. It will be a private (RFC 1918) IP range. Examples: \"10.33.4.55/32\", or \"192.168.5.0/24\".
    #[serde(rename = "sourceAliasIpRange", skip_serializing_if = "Option::is_none")]
    pub source_alias_ip_range: Option<String>,
    /// Primary IP of the VM for this NIC.
    #[serde(rename = "sourceVirtualIp", skip_serializing_if = "Option::is_none")]
    pub source_virtual_ip: Option<String>,
}

impl VmEndpointNatMappingsInterfaceNatMappings {
    /// Contain information of Nat mapping for an interface of this endpoint.
    pub fn new() -> VmEndpointNatMappingsInterfaceNatMappings {
        VmEndpointNatMappingsInterfaceNatMappings {
            drain_nat_ip_port_ranges: None,
            nat_ip_port_ranges: None,
            num_total_drain_nat_ports: None,
            num_total_nat_ports: None,
            rule_mappings: None,
            source_alias_ip_range: None,
            source_virtual_ip: None,
        }
    }
}
