/*
 * Hetzner Cloud API
 *
 * Copied from the official API documentation for the Public Hetzner Cloud.
 *
 * The version of the OpenAPI document: 4b3f595
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// LoadBalancerTargetHealthStatus : Health status of the services on this target. Only present for target types \"server\" and \"ip\".
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LoadBalancerTargetHealthStatus {
    #[serde(rename = "listen_port", skip_serializing_if = "Option::is_none")]
    pub listen_port: Option<i32>,
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
}

impl LoadBalancerTargetHealthStatus {
    /// Health status of the services on this target. Only present for target types \"server\" and \"ip\".
    pub fn new() -> LoadBalancerTargetHealthStatus {
        LoadBalancerTargetHealthStatus {
            listen_port: None,
            status: None,
        }
    }
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "healthy")]
    Healthy,
    #[serde(rename = "unhealthy")]
    Unhealthy,
    #[serde(rename = "unknown")]
    Unknown,
}

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