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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FactPolicyRulesInnerArgumentsInner {
    /// Which value to compare against. If literal, the 'value' field will be used. If 'domainIdentity' then the domain identity will be checked for a capability matching the reference in the 'capability' field. If 'any', this argument can have any value. 
    #[serde(rename = "source")]
    pub source: Source,
    /// An identifier for a capability that might be imported from a peer domain. If it is, it will bear an imported resource prefix (either a domain identifier or an alias, followed by ::) 
    #[serde(rename = "capability", skip_serializing_if = "Option::is_none")]
    pub capability: Option<String>,
    /// if source is literal, what is the value
    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
}

impl FactPolicyRulesInnerArgumentsInner {
    pub fn new(source: Source) -> FactPolicyRulesInnerArgumentsInner {
        FactPolicyRulesInnerArgumentsInner {
            source,
            capability: None,
            value: None,
        }
    }
}
/// Which value to compare against. If literal, the 'value' field will be used. If 'domainIdentity' then the domain identity will be checked for a capability matching the reference in the 'capability' field. If 'any', this argument can have any value. 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Source {
    #[serde(rename = "domainIdentity")]
    DomainIdentity,
    #[serde(rename = "literal")]
    Literal,
    #[serde(rename = "any")]
    Any,
}

impl Default for Source {
    fn default() -> Source {
        Self::DomainIdentity
    }
}