/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.6
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateVariable {
    /// The path to the variable
    #[serde(rename = "path")]
    pub path: String,
    /// The value of the variable
    #[serde(rename = "value")]
    pub value: String,
    /// Whether the variable is a secret
    #[serde(rename = "is_secret")]
    pub is_secret: bool,
    /// The description of the variable
    #[serde(rename = "description")]
    pub description: String,
    /// The account identifier
    #[serde(rename = "account", skip_serializing_if = "Option::is_none")]
    pub account: Option<i32>,
    /// Whether the variable is an OAuth variable
    #[serde(rename = "is_oauth", skip_serializing_if = "Option::is_none")]
    pub is_oauth: Option<bool>,
    /// The expiration date of the variable
    #[serde(rename = "expires_at", skip_serializing_if = "Option::is_none")]
    pub expires_at: Option<String>,
    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
    pub labels: Option<Vec<String>>,
    #[serde(rename = "ws_specific", skip_serializing_if = "Option::is_none")]
    pub ws_specific: Option<bool>,
}

impl CreateVariable {
    pub fn new(path: String, value: String, is_secret: bool, description: String) -> CreateVariable {
        CreateVariable {
            path,
            value,
            is_secret,
            description,
            account: None,
            is_oauth: None,
            expires_at: None,
            labels: None,
            ws_specific: None,
        }
    }
}

