/*
 * 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 ReqRepoContext {
    #[serde(rename = "type")]
    pub r#type: models::EnumContextType,
    #[serde(rename = "visibility")]
    pub visibility: models::EnumContextVisibility,
    #[serde(rename = "url")]
    pub url: String,
    #[serde(rename = "branch")]
    pub branch: String,
    #[serde(rename = "build_file_path")]
    pub build_file_path: String,
    #[serde(rename = "sub_path", skip_serializing_if = "Option::is_none")]
    pub sub_path: Option<String>,
}

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