/*
 * 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 ReqImageBuildTask {
    #[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 = "builder")]
    pub builder: models::EnumBuilder,
    #[serde(rename = "cache", skip_serializing_if = "Option::is_none")]
    pub cache: Option<bool>,
    #[serde(rename = "context")]
    pub context: Box<models::ReqContext>,
    #[serde(rename = "destination")]
    pub destination: Box<models::ReqDestination>,
}

impl ReqImageBuildTask {
    pub fn new(
        id: String,
        r#type: models::EnumTaskType,
        builder: models::EnumBuilder,
        context: models::ReqContext,
        destination: models::ReqDestination,
    ) -> ReqImageBuildTask {
        ReqImageBuildTask {
            id,
            r#type,
            depends_on: None,
            description: None,
            execution_profile: None,
            input: None,
            output: None,
            conditions: None,
            builder,
            cache: None,
            context: Box::new(context),
            destination: Box::new(destination),
        }
    }
}
