/*
 * Tapis Workflows API
 *
 * Create and manage pipelines
 *
 * The version of the OpenAPI document: 1.6.0
 * Contact: cicsupport@tacc.utexas.edu
 * Generated by: https://openapi-generator.tech
 */

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

use serde_with::serde_as;

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[serde(tag = "type")]
pub enum Task {
    #[serde(rename = "image_build")]
    ImageBuild(Box<models::ImageBuildTask>),
    #[serde(rename = "request")]
    Request(Box<models::RequestTask>),
    #[serde(rename = "application")]
    Application(Box<models::ApplicationTask>),
    #[serde(rename = "tapis_job")]
    TapisJob(Box<models::TapisJobTask>),
    #[serde(rename = "tapis_actor")]
    TapisActor(Box<models::TapisActorTask>),
    #[serde(rename = "function")]
    Function(Box<models::FunctionTask>),
    #[serde(rename = "template")]
    Template(Box<models::TemplateTask>),
}

impl Default for Task {
    fn default() -> Self {
        Self::ImageBuild(Default::default())
    }
}
