/*
 * Artifact Keeper API
 *
 * REST API for Artifact Keeper, an open-source universal artifact registry. Covers user management, repositories, artifacts, search, security scanning, SBOM, dependency tracking, SSO, analytics, monitoring, telemetry, lifecycle policies, plugins, edge nodes, migration, and administration. Format-specific protocol endpoints (npm, PyPI, Maven, Docker/OCI, etc.) are not included; those follow their respective upstream specifications.
 *
 * The version of the OpenAPI document: 1.0.0-a2
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GetPluginHealth200Response {
    #[serde(rename = "status")]
    pub status: Status,
    #[serde(rename = "uptime_seconds")]
    pub uptime_seconds: i32,
    #[serde(rename = "memory_usage_bytes", skip_serializing_if = "Option::is_none")]
    pub memory_usage_bytes: Option<i32>,
    #[serde(rename = "last_error", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub last_error: Option<Option<String>>,
}

impl GetPluginHealth200Response {
    pub fn new(status: Status, uptime_seconds: i32) -> GetPluginHealth200Response {
        GetPluginHealth200Response {
            status,
            uptime_seconds,
            memory_usage_bytes: None,
            last_error: None,
        }
    }
}
/// 
#[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
    }
}

