/*
 * Abaco API
 *
 * Abaco (Actor Based Containers) is an API and distributed computing platform funded by the National Science Foundation to provide Functions-as-a-service to the research computing community. Abaco leverages Docker containers and the Actor Model of Concurrent Computation to provide generic function primitives that are portable, composable and scalable.
 *
 * The version of the OpenAPI document: 1
 * Contact: cicsupport@tacc.utexas.edu
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ExecutionSummary {
    /// the time the execution finished.
    #[serde(rename = "finish_time", skip_serializing_if = "Option::is_none")]
    pub finish_time: Option<String>,
    /// the id of the executions
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// the time the execution started.
    #[serde(rename = "start_time", skip_serializing_if = "Option::is_none")]
    pub start_time: Option<String>,
    /// the status of the execution.
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    /// the time the message was originally received by Abaco.
    #[serde(
        rename = "message_received_time",
        skip_serializing_if = "Option::is_none"
    )]
    pub message_received_time: Option<String>,
}

impl ExecutionSummary {
    pub fn new() -> ExecutionSummary {
        ExecutionSummary {
            finish_time: None,
            id: None,
            start_time: None,
            status: None,
            message_received_time: None,
        }
    }
}
/// the status of the execution.
#[derive(
    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum Status {
    #[serde(rename = "SUBMITTED")]
    #[default]
    Submitted,
    #[serde(rename = "RUNNING")]
    Running,
    #[serde(rename = "COMPLETE")]
    Complete,
}
