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

#[serde_as]
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReqPatchTask {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<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", skip_serializing_if = "Option::is_none")]
    pub builder: Option<models::EnumBuilder>,
    #[serde(rename = "cache", skip_serializing_if = "Option::is_none")]
    pub cache: Option<bool>,
    #[serde(rename = "context", skip_serializing_if = "Option::is_none")]
    pub context: Option<Box<models::Context>>,
    #[serde(rename = "destination", skip_serializing_if = "Option::is_none")]
    pub destination: Option<Box<models::Destination>>,
    #[serde(rename = "auth", skip_serializing_if = "Option::is_none")]
    pub auth: Option<serde_json::Value>,
    #[serde(rename = "data", skip_serializing_if = "Option::is_none")]
    pub data: Option<serde_json::Value>,
    #[serde(rename = "headers", skip_serializing_if = "Option::is_none")]
    pub headers: Option<serde_json::Value>,
    #[serde(rename = "http_method", skip_serializing_if = "Option::is_none")]
    pub http_method: Option<models::EnumHttpMethod>,
    #[serde(rename = "query_params", skip_serializing_if = "Option::is_none")]
    pub query_params: Option<serde_json::Value>,
    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    #[serde(rename = "image", skip_serializing_if = "Option::is_none")]
    pub image: Option<String>,
    #[serde(rename = "poll", skip_serializing_if = "Option::is_none")]
    pub poll: Option<bool>,
    #[serde(rename = "tapis_job_def", skip_serializing_if = "Option::is_none")]
    pub tapis_job_def: Option<serde_json::Value>,
    #[serde(rename = "tapis_actor_id", skip_serializing_if = "Option::is_none")]
    pub tapis_actor_id: Option<String>,
    #[serde(
        rename = "tapis_actor_message",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub tapis_actor_message: Option<Option<String>>,
    #[serde(rename = "git_repositories", skip_serializing_if = "Option::is_none")]
    pub git_repositories: Option<Vec<models::GitCloneDetails>>,
    #[serde(rename = "runtime", skip_serializing_if = "Option::is_none")]
    pub runtime: Option<models::EnumRuntimeEnvironment>,
    #[serde(rename = "installer", skip_serializing_if = "Option::is_none")]
    pub installer: Option<models::EnumInstaller>,
    #[serde(rename = "command", skip_serializing_if = "Option::is_none")]
    pub command: Option<String>,
    #[serde(rename = "entrypoint", skip_serializing_if = "Option::is_none")]
    pub entrypoint: Option<String>,
    #[serde_as(as = "Option<serde_with::base64::Base64>")]
    #[serde(rename = "code", skip_serializing_if = "Option::is_none")]
    pub code: Option<Vec<u8>>,
    #[serde(rename = "packages", skip_serializing_if = "Option::is_none")]
    pub packages: Option<Vec<String>>,
    #[serde(rename = "uses", skip_serializing_if = "Option::is_none")]
    pub uses: Option<Box<models::Uses>>,
}

impl ReqPatchTask {
    pub fn new() -> ReqPatchTask {
        ReqPatchTask {
            id: None,
            r#type: None,
            depends_on: None,
            description: None,
            execution_profile: None,
            input: None,
            output: None,
            conditions: None,
            builder: None,
            cache: None,
            context: None,
            destination: None,
            auth: None,
            data: None,
            headers: None,
            http_method: None,
            query_params: None,
            url: None,
            image: None,
            poll: None,
            tapis_job_def: None,
            tapis_actor_id: None,
            tapis_actor_message: None,
            git_repositories: None,
            runtime: None,
            installer: None,
            command: None,
            entrypoint: None,
            code: None,
            packages: None,
            uses: None,
        }
    }
}
