windmill-api 1.683.0

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.0
 * Contact: contact@windmill.dev
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateProtectionRuleRequest {
    /// Unique name for the protection rule
    #[serde(rename = "name")]
    pub name: 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 CreateProtectionRuleRequest {
    pub fn new(name: String, rules: Vec<models::ProtectionRuleKind>, bypass_groups: Vec<String>, bypass_users: Vec<String>) -> CreateProtectionRuleRequest {
        CreateProtectionRuleRequest {
            name,
            rules,
            bypass_groups,
            bypass_users,
        }
    }
}