/*
 * Hetzner Cloud API
 *
 * Copied from the official API documentation for the Public Hetzner Cloud.
 *
 * The version of the OpenAPI document: 4b3f595
 *
 * Generated by: https://openapi-generator.tech
 */

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

/// SetRulesRequest : Request for POST https://api.hetzner.cloud/v1/firewalls/{id}/actions/set_rules
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SetRulesRequest {
    /// Array of rules.  Rules are limited to 50 entries per Firewall and [500 effective rules](https://docs.hetzner.com/cloud/firewalls/overview#limits).  Existing rules will be replaced.
    #[serde(rename = "rules")]
    pub rules: Vec<models::Rule>,
}

impl SetRulesRequest {
    /// Request for POST https://api.hetzner.cloud/v1/firewalls/{id}/actions/set_rules
    pub fn new(rules: Vec<models::Rule>) -> SetRulesRequest {
        SetRulesRequest { rules }
    }
}
