/*
 * 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 Folder {
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "owners")]
    pub owners: Vec<String>,
    #[serde(rename = "extra_perms")]
    pub extra_perms: std::collections::HashMap<String, bool>,
    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
    pub summary: Option<String>,
    #[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>,
    /// Ordered list of rules applied at create-time when admins or `wm_deployers` members deploy items in this folder. The first rule whose `path_glob` matches the item path (relative to the folder root) wins, and its `permissioned_as` is used as the default. 
    #[serde(rename = "default_permissioned_as", skip_serializing_if = "Option::is_none")]
    pub default_permissioned_as: Option<Vec<models::FolderDefaultPermissionedAsInner>>,
}

impl Folder {
    pub fn new(name: String, owners: Vec<String>, extra_perms: std::collections::HashMap<String, bool>) -> Folder {
        Folder {
            name,
            owners,
            extra_perms,
            summary: None,
            created_by: None,
            edited_at: None,
            default_permissioned_as: None,
        }
    }
}

