/*
 * 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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReqTemplateTask {
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "type")]
    pub r#type: models::EnumTaskType,
    #[serde(rename = "depends_on", skip_serializing_if = "Option::is_none")]
    pub depends_on: Option<Vec<models::TaskDependency>>,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "execution_profile", skip_serializing_if = "Option::is_none")]
    pub execution_profile: Option<Box<models::TaskExecutionProfile>>,
    #[serde(rename = "input", skip_serializing_if = "Option::is_none")]
    pub input: Option<std::collections::HashMap<String, models::SpecWithValue>>,
    #[serde(rename = "output", skip_serializing_if = "Option::is_none")]
    pub output: Option<std::collections::HashMap<String, models::OutputValue>>,
    #[serde(rename = "conditions", skip_serializing_if = "Option::is_none")]
    pub conditions: Option<Vec<std::collections::HashMap<String, serde_json::Value>>>,
    #[serde(rename = "uses")]
    pub uses: Box<models::Uses>,
}

impl ReqTemplateTask {
    pub fn new(id: String, r#type: models::EnumTaskType, uses: models::Uses) -> ReqTemplateTask {
        ReqTemplateTask {
            id,
            r#type,
            depends_on: None,
            description: None,
            execution_profile: None,
            input: None,
            output: None,
            conditions: None,
            uses: Box::new(uses),
        }
    }
}
