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 ReadContextDetailsAttachedPoliciesInner {
    /// An identifier for a potentially imported policy
    #[serde(rename = "policyID")]
    pub policy_id: String,
    #[serde(rename = "policyName")]
    pub policy_name: String,
    /// true if this policy is imported
    #[serde(rename = "imported")]
    pub imported: bool,
    /// A globally unique identifier for a domain
    #[serde(rename = "sourceDomainID", skip_serializing_if = "Option::is_none")]
    pub source_domain_id: Option<String>,
    #[serde(rename = "sourceDomainName", skip_serializing_if = "Option::is_none")]
    pub source_domain_name: Option<String>,
    /// This is the actual status of this binding, looking at our config, the peer config, and the actual  availability of the policy 
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<Status>,
    /// This defines why the policy has the above status 
    #[serde(rename = "statusSource", skip_serializing_if = "Option::is_none")]
    pub status_source: Option<StatusSource>,
}

impl ReadContextDetailsAttachedPoliciesInner {
    pub fn new(policy_id: String, policy_name: String, imported: bool) -> ReadContextDetailsAttachedPoliciesInner {
        ReadContextDetailsAttachedPoliciesInner {
            policy_id,
            policy_name,
            imported,
            source_domain_id: None,
            source_domain_name: None,
            status: None,
            status_source: None,
        }
    }
}
/// This is the actual status of this binding, looking at our config, the peer config, and the actual  availability of the policy 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
    #[serde(rename = "Attached")]
    Attached,
    #[serde(rename = "NotAttached")]
    NotAttached,
    #[serde(rename = "Unavailable")]
    Unavailable,
}

impl Default for Status {
    fn default() -> Status {
        Self::Attached
    }
}
/// This defines why the policy has the above status 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StatusSource {
    #[serde(rename = "Default")]
    Default,
    #[serde(rename = "PeerDefault")]
    PeerDefault,
    #[serde(rename = "PeerContextConfiguration")]
    PeerContextConfiguration,
    #[serde(rename = "ContextConfiguration")]
    ContextConfiguration,
    #[serde(rename = "NoConfiguration")]
    NoConfiguration,
}

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