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

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ManagedInstanceInstanceHealth {
    /// [Output Only] The current detailed instance health state.
    #[serde(
        rename = "detailedHealthState",
        skip_serializing_if = "Option::is_none"
    )]
    pub detailed_health_state: Option<DetailedHealthState>,
    /// [Output Only] The URL for the health check that verifies whether the instance is healthy.
    #[serde(rename = "healthCheck", skip_serializing_if = "Option::is_none")]
    pub health_check: Option<String>,
}

impl ManagedInstanceInstanceHealth {
    pub fn new() -> ManagedInstanceInstanceHealth {
        ManagedInstanceInstanceHealth {
            detailed_health_state: None,
            health_check: None,
        }
    }
}

/// [Output Only] The current detailed instance health state.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum DetailedHealthState {
    #[serde(rename = "DRAINING")]
    Draining,
    #[serde(rename = "HEALTHY")]
    Healthy,
    #[serde(rename = "TIMEOUT")]
    Timeout,
    #[serde(rename = "UNHEALTHY")]
    Unhealthy,
    #[serde(rename = "UNKNOWN")]
    Unknown,
}

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