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;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct InstanceWithNamedPorts {
    /// [Output Only] The URL of the instance.
    #[serde(rename = "instance", skip_serializing_if = "Option::is_none")]
    pub instance: Option<String>,
    /// [Output Only] The named ports that belong to this instance group.
    #[serde(rename = "namedPorts", skip_serializing_if = "Option::is_none")]
    pub named_ports: Option<Vec<models::NamedPort>>,
    /// [Output Only] The status of the instance.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
}

impl InstanceWithNamedPorts {
    pub fn new() -> InstanceWithNamedPorts {
        InstanceWithNamedPorts {
            instance: None,
            named_ports: None,
            status: None,
        }
    }
}
/// [Output Only] The status of the instance.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "DEPROVISIONING")]
    Deprovisioning,
    #[serde(rename = "PROVISIONING")]
    Provisioning,
    #[serde(rename = "REPAIRING")]
    Repairing,
    #[serde(rename = "RUNNING")]
    Running,
    #[serde(rename = "STAGING")]
    Staging,
    #[serde(rename = "STOPPED")]
    Stopped,
    #[serde(rename = "STOPPING")]
    Stopping,
    #[serde(rename = "SUSPENDED")]
    Suspended,
    #[serde(rename = "SUSPENDING")]
    Suspending,
    #[serde(rename = "TERMINATED")]
    Terminated,
}

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