/*
 * 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 ReqPipeline {
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "uses", skip_serializing_if = "Option::is_none")]
    pub uses: Option<Box<models::Uses>>,
    #[serde(rename = "archive_ids", skip_serializing_if = "Option::is_none")]
    pub archive_ids: Option<Vec<String>>,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "env", skip_serializing_if = "Option::is_none")]
    pub env: Option<std::collections::HashMap<String, models::EnvSpec>>,
    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    #[serde(rename = "params", skip_serializing_if = "Option::is_none")]
    pub params: Option<std::collections::HashMap<String, models::Spec>>,
    #[serde(rename = "type")]
    pub r#type: models::EnumPipelineType,
    #[serde(rename = "execution_profile", skip_serializing_if = "Option::is_none")]
    pub execution_profile: Option<Box<models::ExecutionProfile>>,
    #[serde(rename = "tasks", skip_serializing_if = "Option::is_none")]
    pub tasks: Option<Vec<models::ReqTask>>,
}

impl ReqPipeline {
    pub fn new(id: String, r#type: models::EnumPipelineType) -> ReqPipeline {
        ReqPipeline {
            id,
            uses: None,
            archive_ids: None,
            description: None,
            env: None,
            enabled: None,
            params: None,
            r#type,
            execution_profile: None,
            tasks: None,
        }
    }
}
