/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.6
 * Contact: contact@orvanta.cloud
 * 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,
        }
    }
}

