1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Windmill API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.683.2
* 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,
}
}
}