windmill-api 1.683.1

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Windmill API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.683.1
 * Contact: contact@windmill.dev
 * Generated by: https://openapi-generator.tech
 */

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

/// ProtectionRuleset : A workspace protection rule defining restrictions and bypass permissions
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ProtectionRuleset {
    /// Unique name for the protection rule
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "workspace_id", skip_serializing_if = "Option::is_none")]
    pub workspace_id: Option<String>,
    /// Configuration of protection restrictions
    #[serde(rename = "rules")]
    pub rules: Vec<models::ProtectionRuleKind>,
    /// Groups that can bypass this ruleset
    #[serde(rename = "bypass_groups")]
    pub bypass_groups: Vec<String>,
    /// Users that can bypass this ruleset
    #[serde(rename = "bypass_users")]
    pub bypass_users: Vec<String>,
}

impl ProtectionRuleset {
    /// A workspace protection rule defining restrictions and bypass permissions
    pub fn new(name: String, rules: Vec<models::ProtectionRuleKind>, bypass_groups: Vec<String>, bypass_users: Vec<String>) -> ProtectionRuleset {
        ProtectionRuleset {
            name,
            workspace_id: None,
            rules,
            bypass_groups,
            bypass_users,
        }
    }
}