/*
 * Cloud Hypervisor API
 *
 * Local HTTP based API for managing and inspecting a cloud-hypervisor virtual machine.
 *
 * The version of the OpenAPI document: 0.3.0
 *
 * Generated by: https://openapi-generator.tech
 */

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

///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum VmState {
    #[serde(rename = "Created")]
    Created,
    #[serde(rename = "Running")]
    Running,
    #[serde(rename = "Shutdown")]
    Shutdown,
    #[serde(rename = "Paused")]
    Paused,
}

impl std::fmt::Display for VmState {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::Created => write!(f, "Created"),
            Self::Running => write!(f, "Running"),
            Self::Shutdown => write!(f, "Shutdown"),
            Self::Paused => write!(f, "Paused"),
        }
    }
}

impl Default for VmState {
    fn default() -> VmState {
        Self::Created
    }
}
