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

/// RouterNatSubnetworkToNat : Defines the IP ranges that want to use NAT for a subnetwork.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct RouterNatSubnetworkToNat {
    /// URL for the subnetwork resource that will use NAT.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// A list of the secondary ranges of the Subnetwork that are allowed to use NAT. This can be populated only if \"LIST_OF_SECONDARY_IP_RANGES\" is one of the values in source_ip_ranges_to_nat.
    #[serde(
        rename = "secondaryIpRangeNames",
        skip_serializing_if = "Option::is_none"
    )]
    pub secondary_ip_range_names: Option<Vec<String>>,
    /// Specify the options for NAT ranges in the Subnetwork. All options of a single value are valid except NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple values is: [\"PRIMARY_IP_RANGE\", \"LIST_OF_SECONDARY_IP_RANGES\"] Default: [ALL_IP_RANGES]
    #[serde(
        rename = "sourceIpRangesToNat",
        skip_serializing_if = "Option::is_none"
    )]
    pub source_ip_ranges_to_nat: Option<Vec<SourceIpRangesToNat>>,
}

impl RouterNatSubnetworkToNat {
    /// Defines the IP ranges that want to use NAT for a subnetwork.
    pub fn new() -> RouterNatSubnetworkToNat {
        RouterNatSubnetworkToNat {
            name: None,
            secondary_ip_range_names: None,
            source_ip_ranges_to_nat: None,
        }
    }
}

/// Specify the options for NAT ranges in the Subnetwork. All options of a single value are valid except NAT_IP_RANGE_OPTION_UNSPECIFIED. The only valid option with multiple values is: [\"PRIMARY_IP_RANGE\", \"LIST_OF_SECONDARY_IP_RANGES\"] Default: [ALL_IP_RANGES]
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SourceIpRangesToNat {
    #[serde(rename = "ALL_IP_RANGES")]
    AllIpRanges,
    #[serde(rename = "LIST_OF_SECONDARY_IP_RANGES")]
    ListOfSecondaryIpRanges,
    #[serde(rename = "PRIMARY_IP_RANGE")]
    PrimaryIpRange,
}

impl Default for SourceIpRangesToNat {
    fn default() -> SourceIpRangesToNat {
        Self::AllIpRanges
    }
}
