/*
 * 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 Resource {
    #[serde(rename = "workspace_id", skip_serializing_if = "Option::is_none")]
    pub workspace_id: Option<String>,
    #[serde(rename = "path")]
    pub path: String,
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(rename = "resource_type")]
    pub resource_type: String,
    #[serde(rename = "value", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub value: Option<Option<serde_json::Value>>,
    #[serde(rename = "is_oauth")]
    pub is_oauth: bool,
    #[serde(rename = "extra_perms", skip_serializing_if = "Option::is_none")]
    pub extra_perms: Option<std::collections::HashMap<String, bool>>,
    #[serde(rename = "created_by", skip_serializing_if = "Option::is_none")]
    pub created_by: Option<String>,
    #[serde(rename = "edited_at", skip_serializing_if = "Option::is_none")]
    pub edited_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 Resource {
    pub fn new(path: String, resource_type: String, is_oauth: bool) -> Resource {
        Resource {
            workspace_id: None,
            path,
            description: None,
            resource_type,
            value: None,
            is_oauth,
            extra_perms: None,
            created_by: None,
            edited_at: None,
            labels: None,
            ws_specific: None,
        }
    }
}

