Skip to main content

windmill_api/models/
create_protection_rule_request.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.630.2
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CreateProtectionRuleRequest {
16    /// Unique name for the protection rule
17    #[serde(rename = "name")]
18    pub name: String,
19    /// Configuration of protection restrictions
20    #[serde(rename = "rules")]
21    pub rules: Vec<models::ProtectionRuleKind>,
22    /// Groups that can bypass this ruleset
23    #[serde(rename = "bypass_groups")]
24    pub bypass_groups: Vec<String>,
25    /// Users that can bypass this ruleset
26    #[serde(rename = "bypass_users")]
27    pub bypass_users: Vec<String>,
28}
29
30impl CreateProtectionRuleRequest {
31    pub fn new(name: String, rules: Vec<models::ProtectionRuleKind>, bypass_groups: Vec<String>, bypass_users: Vec<String>) -> CreateProtectionRuleRequest {
32        CreateProtectionRuleRequest {
33            name,
34            rules,
35            bypass_groups,
36            bypass_users,
37        }
38    }
39}
40