antimatter_api 2.0.13

Interact with the Antimatter Cloud API
Documentation
/*
 * Antimatter Public API
 *
 * Interact with the Antimatter Cloud API
 *
 * The version of the OpenAPI document: 2.0.13
 * Contact: support@antimatter.io
 * Generated by: https://openapi-generator.tech
 */

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

/// NewDomainPolicyRule : A rule governing the domain's policy. All domain identity capabilities must match (AND) for the action to take effect. If the domainIdentity or facts sections are omitted, they match all domain identities and any fact configurations respectively. 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct NewDomainPolicyRule {
    #[serde(rename = "domainIdentity", skip_serializing_if = "Option::is_none")]
    pub domain_identity: Option<Box<models::CapabilityRule>>,
    /// assert the existence or nonexistence of facts that reference the domainIdentity. These assertions will be ANDed together, and ANDed with the domainIdentity expression 
    #[serde(rename = "facts", skip_serializing_if = "Option::is_none")]
    pub facts: Option<Vec<models::FactPolicyRulesInner>>,
    /// the path this rule governs. This pattern may contain glob expressions (e.g. '*' and '**'). 
    #[serde(rename = "path")]
    pub path: String,
    #[serde(rename = "operation")]
    pub operation: models::PolicyRuleOperation,
    #[serde(rename = "result")]
    pub result: models::PolicyRuleResult,
    /// This rule's priority. Lower priority numbers rules are evaluated first
    #[serde(rename = "priority")]
    pub priority: i32,
    /// If this rule is disabled or not.
    #[serde(rename = "disabled")]
    pub disabled: bool,
}

impl NewDomainPolicyRule {
    /// A rule governing the domain's policy. All domain identity capabilities must match (AND) for the action to take effect. If the domainIdentity or facts sections are omitted, they match all domain identities and any fact configurations respectively. 
    pub fn new(path: String, operation: models::PolicyRuleOperation, result: models::PolicyRuleResult, priority: i32, disabled: bool) -> NewDomainPolicyRule {
        NewDomainPolicyRule {
            domain_identity: None,
            facts: None,
            path,
            operation,
            result,
            priority,
            disabled,
        }
    }
}