/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.2.0
 * 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 ListableVariable {
    #[serde(rename = "workspace_id")]
    pub workspace_id: String,
    #[serde(rename = "path")]
    pub path: String,
    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
    #[serde(rename = "is_secret")]
    pub is_secret: bool,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "account", skip_serializing_if = "Option::is_none")]
    pub account: Option<i32>,
    #[serde(rename = "is_oauth", skip_serializing_if = "Option::is_none")]
    pub is_oauth: Option<bool>,
    #[serde(rename = "extra_perms")]
    pub extra_perms: std::collections::HashMap<String, bool>,
    #[serde(rename = "is_expired", skip_serializing_if = "Option::is_none")]
    pub is_expired: Option<bool>,
    #[serde(rename = "refresh_error", skip_serializing_if = "Option::is_none")]
    pub refresh_error: Option<String>,
    #[serde(rename = "is_linked", skip_serializing_if = "Option::is_none")]
    pub is_linked: Option<bool>,
    #[serde(rename = "is_refreshed", skip_serializing_if = "Option::is_none")]
    pub is_refreshed: Option<bool>,
    #[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 ListableVariable {
    pub fn new(workspace_id: String, path: String, is_secret: bool, extra_perms: std::collections::HashMap<String, bool>) -> ListableVariable {
        ListableVariable {
            workspace_id,
            path,
            value: None,
            is_secret,
            description: None,
            account: None,
            is_oauth: None,
            extra_perms,
            is_expired: None,
            refresh_error: None,
            is_linked: None,
            is_refreshed: None,
            expires_at: None,
            labels: None,
            ws_specific: None,
        }
    }
}

