/*
 * 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 Context {
    #[serde(rename = "branch", skip_serializing_if = "Option::is_none")]
    pub branch: Option<String>,
    #[serde(
        rename = "credentials",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub credentials: Option<Option<serde_json::Value>>,
    #[serde(rename = "build_file_path", skip_serializing_if = "Option::is_none")]
    pub build_file_path: Option<String>,
    #[serde(rename = "sub_path", skip_serializing_if = "Option::is_none")]
    pub sub_path: Option<String>,
    #[serde(rename = "type")]
    pub r#type: models::EnumContextType,
    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
    pub url: Option<String>,
    #[serde(rename = "visibility", skip_serializing_if = "Option::is_none")]
    pub visibility: Option<models::EnumContextVisibility>,
}

impl Context {
    pub fn new(r#type: models::EnumContextType) -> Context {
        Context {
            branch: None,
            credentials: None,
            build_file_path: None,
            sub_path: None,
            r#type,
            url: None,
            visibility: None,
        }
    }
}
