/*
 * Mithril
 *
 * Mithril Compute API
 *
 * The version of the OpenAPI document: 1.0.0
 *
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct KubernetesClusterModel {
    #[serde(rename = "fid")]
    pub fid: String,
    #[serde(rename = "project")]
    pub project: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "region")]
    pub region: String,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "kube_host", skip_serializing_if = "Option::is_none")]
    pub kube_host: Option<String>,
    #[serde(rename = "ssh_keys")]
    pub ssh_keys: Vec<String>,
    #[serde(rename = "instances")]
    pub instances: Vec<String>,
    #[serde(rename = "join_command", skip_serializing_if = "Option::is_none")]
    pub join_command: Option<String>,
    #[serde(rename = "status")]
    pub status: Status,
    #[serde(rename = "deleted_at", skip_serializing_if = "Option::is_none")]
    pub deleted_at: Option<String>,
    #[serde(rename = "k8s_version")]
    pub k8s_version: String,
    #[serde(rename = "user_fid", skip_serializing_if = "Option::is_none")]
    pub user_fid: Option<String>,
}

impl KubernetesClusterModel {
    pub fn new(
        fid: String,
        project: String,
        name: String,
        region: String,
        created_at: String,
        ssh_keys: Vec<String>,
        instances: Vec<String>,
        status: Status,
        k8s_version: String,
    ) -> KubernetesClusterModel {
        KubernetesClusterModel {
            fid,
            project,
            name,
            region,
            created_at,
            kube_host: None,
            ssh_keys,
            instances,
            join_command: None,
            status,
            deleted_at: None,
            k8s_version,
            user_fid: None,
        }
    }
}
///
#[derive(
    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum Status {
    #[serde(rename = "Pending")]
    #[default]
    Pending,
    #[serde(rename = "Available")]
    Available,
    #[serde(rename = "Terminated")]
    Terminated,
}
