use serde::{Deserialize, Serialize}; /*
                                      * Cloud DNS API
                                      *
                                      * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
                                      *
                                      * The version of the OpenAPI document: v1
                                      *
                                      * Generated by: https://openapi-generator.tech
                                      */

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct PolicyAlternativeNameServerConfigTargetNameServer {
    /// Forwarding path for this TargetNameServer. If unset or set to DEFAULT, Cloud DNS makes forwarding decisions based on address ranges; that is, RFC1918 addresses go to the VPC network, non-RFC1918 addresses go to the internet. When set to PRIVATE, Cloud DNS always sends queries through the VPC network for this target.
    #[serde(rename = "forwardingPath", skip_serializing_if = "Option::is_none")]
    pub forwarding_path: Option<ForwardingPath>,
    /// IPv4 address to forward queries to.
    #[serde(rename = "ipv4Address", skip_serializing_if = "Option::is_none")]
    pub ipv4_address: Option<String>,
    /// IPv6 address to forward to. Does not accept both fields (ipv4 & ipv6) being populated. Public preview as of November 2022.
    #[serde(rename = "ipv6Address", skip_serializing_if = "Option::is_none")]
    pub ipv6_address: Option<String>,
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
}

impl PolicyAlternativeNameServerConfigTargetNameServer {
    pub fn new() -> PolicyAlternativeNameServerConfigTargetNameServer {
        PolicyAlternativeNameServerConfigTargetNameServer {
            forwarding_path: None,
            ipv4_address: None,
            ipv6_address: None,
            kind: None,
        }
    }
}

/// Forwarding path for this TargetNameServer. If unset or set to DEFAULT, Cloud DNS makes forwarding decisions based on address ranges; that is, RFC1918 addresses go to the VPC network, non-RFC1918 addresses go to the internet. When set to PRIVATE, Cloud DNS always sends queries through the VPC network for this target.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ForwardingPath {
    #[serde(rename = "default")]
    Default,
    #[serde(rename = "private")]
    Private,
}

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