Skip to main content

windmill_api/models/
update_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 UpdateProtectionRuleRequest {
16    /// Configuration of protection restrictions
17    #[serde(rename = "rules")]
18    pub rules: Vec<models::ProtectionRuleKind>,
19    /// Groups that can bypass this ruleset
20    #[serde(rename = "bypass_groups")]
21    pub bypass_groups: Vec<String>,
22    /// Users that can bypass this ruleset
23    #[serde(rename = "bypass_users")]
24    pub bypass_users: Vec<String>,
25}
26
27impl UpdateProtectionRuleRequest {
28    pub fn new(rules: Vec<models::ProtectionRuleKind>, bypass_groups: Vec<String>, bypass_users: Vec<String>) -> UpdateProtectionRuleRequest {
29        UpdateProtectionRuleRequest {
30            rules,
31            bypass_groups,
32            bypass_users,
33        }
34    }
35}
36