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

/// PublicAdvertisedPrefix : A public advertised prefix represents an aggregated IP prefix or netblock which customers bring to cloud. The IP prefix is a single unit of route advertisement and is announced globally to the internet.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct PublicAdvertisedPrefix {
    /// [Output Only] The version of BYOIP API.
    #[serde(rename = "byoipApiVersion", skip_serializing_if = "Option::is_none")]
    pub byoip_api_version: Option<ByoipApiVersion>,
    /// [Output Only] Creation timestamp in RFC3339 text format.
    #[serde(rename = "creationTimestamp", skip_serializing_if = "Option::is_none")]
    pub creation_timestamp: Option<String>,
    /// An optional description of this resource. Provide this property when you create the resource.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// The address to be used for reverse DNS verification.
    #[serde(rename = "dnsVerificationIp", skip_serializing_if = "Option::is_none")]
    pub dns_verification_ip: Option<String>,
    /// Fingerprint of this resource. A hash of the contents stored in this object. This field is used in optimistic locking. This field will be ignored when inserting a new PublicAdvertisedPrefix. An up-to-date fingerprint must be provided in order to update the PublicAdvertisedPrefix, otherwise the request will fail with error 412 conditionNotMet. To see the latest fingerprint, make a get() request to retrieve a PublicAdvertisedPrefix.
    #[serde(rename = "fingerprint", skip_serializing_if = "Option::is_none")]
    pub fingerprint: Option<String>,
    /// [Output Only] The unique identifier for the resource type. The server generates this identifier.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// The address range, in CIDR format, represented by this public advertised prefix.
    #[serde(rename = "ipCidrRange", skip_serializing_if = "Option::is_none")]
    pub ip_cidr_range: Option<String>,
    /// [Output Only] Type of the resource. Always compute#publicAdvertisedPrefix for public advertised prefixes.
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// Specifies how child public delegated prefix will be scoped. It could be one of following values: - `REGIONAL`: The public delegated prefix is regional only. The provisioning will take a few minutes. - `GLOBAL`: The public delegated prefix is global only. The provisioning will take ~4 weeks. - `GLOBAL_AND_REGIONAL` [output only]: The public delegated prefixes is BYOIP V1 legacy prefix. This is output only value and no longer supported in BYOIP V2. 
    #[serde(rename = "pdpScope", skip_serializing_if = "Option::is_none")]
    pub pdp_scope: Option<PdpScope>,
    /// [Output Only] The list of public delegated prefixes that exist for this public advertised prefix.
    #[serde(rename = "publicDelegatedPrefixs", skip_serializing_if = "Option::is_none")]
    pub public_delegated_prefixs: Option<Vec<crate::google_rest_apis::compute_v1::models::PublicAdvertisedPrefixPublicDelegatedPrefix>>,
    /// [Output Only] Server-defined URL for the resource.
    #[serde(rename = "selfLink", skip_serializing_if = "Option::is_none")]
    pub self_link: Option<String>,
    /// [Output Only] The shared secret to be used for reverse DNS verification.
    #[serde(rename = "sharedSecret", skip_serializing_if = "Option::is_none")]
    pub shared_secret: Option<String>,
    /// The status of the public advertised prefix. Possible values include: - `INITIAL`: RPKI validation is complete. - `PTR_CONFIGURED`: User has configured the PTR. - `VALIDATED`: Reverse DNS lookup is successful. - `REVERSE_DNS_LOOKUP_FAILED`: Reverse DNS lookup failed. - `PREFIX_CONFIGURATION_IN_PROGRESS`: The prefix is being configured. - `PREFIX_CONFIGURATION_COMPLETE`: The prefix is fully configured. - `PREFIX_REMOVAL_IN_PROGRESS`: The prefix is being removed. 
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
}

impl PublicAdvertisedPrefix {
    /// A public advertised prefix represents an aggregated IP prefix or netblock which customers bring to cloud. The IP prefix is a single unit of route advertisement and is announced globally to the internet.
    pub fn new() -> PublicAdvertisedPrefix {
        PublicAdvertisedPrefix {
            byoip_api_version: None,
            creation_timestamp: None,
            description: None,
            dns_verification_ip: None,
            fingerprint: None,
            id: None,
            ip_cidr_range: None,
            kind: None,
            name: None,
            pdp_scope: None,
            public_delegated_prefixs: None,
            self_link: None,
            shared_secret: None,
            status: None,
        }
    }
}

/// [Output Only] The version of BYOIP API.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ByoipApiVersion {
    #[serde(rename = "V1")]
    V1,
    #[serde(rename = "V2")]
    V2,
}

impl Default for ByoipApiVersion {
    fn default() -> ByoipApiVersion {
        Self::V1
    }
}
/// Specifies how child public delegated prefix will be scoped. It could be one of following values: - `REGIONAL`: The public delegated prefix is regional only. The provisioning will take a few minutes. - `GLOBAL`: The public delegated prefix is global only. The provisioning will take ~4 weeks. - `GLOBAL_AND_REGIONAL` [output only]: The public delegated prefixes is BYOIP V1 legacy prefix. This is output only value and no longer supported in BYOIP V2.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PdpScope {
    #[serde(rename = "GLOBAL")]
    Global,
    #[serde(rename = "GLOBAL_AND_REGIONAL")]
    GlobalAndRegional,
    #[serde(rename = "REGIONAL")]
    Regional,
}

impl Default for PdpScope {
    fn default() -> PdpScope {
        Self::Global
    }
}
/// The status of the public advertised prefix. Possible values include: - `INITIAL`: RPKI validation is complete. - `PTR_CONFIGURED`: User has configured the PTR. - `VALIDATED`: Reverse DNS lookup is successful. - `REVERSE_DNS_LOOKUP_FAILED`: Reverse DNS lookup failed. - `PREFIX_CONFIGURATION_IN_PROGRESS`: The prefix is being configured. - `PREFIX_CONFIGURATION_COMPLETE`: The prefix is fully configured. - `PREFIX_REMOVAL_IN_PROGRESS`: The prefix is being removed.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "ANNOUNCED_TO_INTERNET")]
    AnnouncedToInternet,
    #[serde(rename = "INITIAL")]
    Initial,
    #[serde(rename = "PREFIX_CONFIGURATION_COMPLETE")]
    PrefixConfigurationComplete,
    #[serde(rename = "PREFIX_CONFIGURATION_IN_PROGRESS")]
    PrefixConfigurationInProgress,
    #[serde(rename = "PREFIX_REMOVAL_IN_PROGRESS")]
    PrefixRemovalInProgress,
    #[serde(rename = "PTR_CONFIGURED")]
    PtrConfigured,
    #[serde(rename = "READY_TO_ANNOUNCE")]
    ReadyToAnnounce,
    #[serde(rename = "REVERSE_DNS_LOOKUP_FAILED")]
    ReverseDnsLookupFailed,
    #[serde(rename = "VALIDATED")]
    Validated,
}

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