/*
 * Hotdata API
 *
 * Powerful data platform API for datasets, queries, and analytics.
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: developers@hotdata.dev
 * Generated by: https://openapi-generator.tech
 */

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

/// JobType : Background job types returned by the API.
/// Background job types returned by the API.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum JobType {
    #[serde(rename = "noop")]
    Noop,
    #[serde(rename = "data_refresh_table")]
    DataRefreshTable,
    #[serde(rename = "data_refresh_connection")]
    DataRefreshConnection,
    #[serde(rename = "dataset_refresh")]
    DatasetRefresh,
    #[serde(rename = "create_index")]
    CreateIndex,
    #[serde(rename = "create_dataset_index")]
    CreateDatasetIndex,
}

impl std::fmt::Display for JobType {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::Noop => write!(f, "noop"),
            Self::DataRefreshTable => write!(f, "data_refresh_table"),
            Self::DataRefreshConnection => write!(f, "data_refresh_connection"),
            Self::DatasetRefresh => write!(f, "dataset_refresh"),
            Self::CreateIndex => write!(f, "create_index"),
            Self::CreateDatasetIndex => write!(f, "create_dataset_index"),
        }
    }
}

impl Default for JobType {
    fn default() -> JobType {
        Self::Noop
    }
}
