/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.2.0
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

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

/// DetailedHealthResponse : Detailed health status response (always fresh, no caching)
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DetailedHealthResponse {
    /// Overall health status
    #[serde(rename = "status")]
    pub status: Status,
    /// Timestamp when the health check was performed
    #[serde(rename = "checked_at")]
    pub checked_at: String,
    /// Server version (e.g., \"EE 1.615.3\")
    #[serde(rename = "version")]
    pub version: String,
    #[serde(rename = "checks")]
    pub checks: Box<models::HealthChecks>,
}

impl DetailedHealthResponse {
    /// Detailed health status response (always fresh, no caching)
    pub fn new(status: Status, checked_at: String, version: String, checks: models::HealthChecks) -> DetailedHealthResponse {
        DetailedHealthResponse {
            status,
            checked_at,
            version,
            checks: Box::new(checks),
        }
    }
}
/// Overall health status
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "healthy")]
    Healthy,
    #[serde(rename = "degraded")]
    Degraded,
    #[serde(rename = "unhealthy")]
    Unhealthy,
}

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

