hotdata 0.15.0

Powerful data platform API for datasets, queries, and analytics.
Documentation
/*
 * Hotdata API
 *
 * Powerful data platform API for instant databases, 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};

/// JobStatus : Current status of a background job. One of five values:  - `pending` — queued, not started yet. - `running` — currently executing. - `succeeded` — finished, everything it was asked to do worked. - `partially_succeeded` — finished, but some of its work failed while the   rest succeeded (for example some of the databases in a bulk creation).   Read `error_message` for what was skipped. - `failed` — did not finish; every retry was used up. Read `error_message`.  `succeeded`, `partially_succeeded`, and `failed` are final — a job in one of those will not change again, so a poll loop can stop there. `pending` and `running` mean keep polling. Treat `partially_succeeded` as its own outcome rather than folding it into either success or failure: the job produced a `result`, but not for all of its work.
/// Current status of a background job. One of five values:  - `pending` — queued, not started yet. - `running` — currently executing. - `succeeded` — finished, everything it was asked to do worked. - `partially_succeeded` — finished, but some of its work failed while the   rest succeeded (for example some of the databases in a bulk creation).   Read `error_message` for what was skipped. - `failed` — did not finish; every retry was used up. Read `error_message`.  `succeeded`, `partially_succeeded`, and `failed` are final — a job in one of those will not change again, so a poll loop can stop there. `pending` and `running` mean keep polling. Treat `partially_succeeded` as its own outcome rather than folding it into either success or failure: the job produced a `result`, but not for all of its work.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum JobStatus {
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "running")]
    Running,
    #[serde(rename = "succeeded")]
    Succeeded,
    #[serde(rename = "partially_succeeded")]
    PartiallySucceeded,
    #[serde(rename = "failed")]
    Failed,
}

impl std::fmt::Display for JobStatus {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Self::Pending => write!(f, "pending"),
            Self::Running => write!(f, "running"),
            Self::Succeeded => write!(f, "succeeded"),
            Self::PartiallySucceeded => write!(f, "partially_succeeded"),
            Self::Failed => write!(f, "failed"),
        }
    }
}

impl Default for JobStatus {
    fn default() -> JobStatus {
        Self::Pending
    }
}