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 DataPolicyBindingInfo {
    /// 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>,
    #[serde(rename = "readContexts")]
    pub read_contexts: Vec<models::DataPolicyBindingInfoReadContextsInner>,
    /// what is our default binding? For imported policies, this defaults to Inherit, for our own policies this defaults to NotAttached 
    #[serde(rename = "defaultAttachment")]
    pub default_attachment: DefaultAttachment,
    /// if this is an imported policy, what is the peer's default binding config for it? 
    #[serde(rename = "peerDefault", skip_serializing_if = "Option::is_none")]
    pub peer_default: Option<PeerDefault>,
}

impl DataPolicyBindingInfo {
    pub fn new(policy_id: String, policy_name: String, imported: bool, read_contexts: Vec<models::DataPolicyBindingInfoReadContextsInner>, default_attachment: DefaultAttachment) -> DataPolicyBindingInfo {
        DataPolicyBindingInfo {
            policy_id,
            policy_name,
            imported,
            source_domain_id: None,
            source_domain_name: None,
            read_contexts,
            default_attachment,
            peer_default: None,
        }
    }
}
/// what is our default binding? For imported policies, this defaults to Inherit, for our own policies this defaults to NotAttached 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum DefaultAttachment {
    #[serde(rename = "Inherit")]
    Inherit,
    #[serde(rename = "NotAttached")]
    NotAttached,
    #[serde(rename = "Attached")]
    Attached,
}

impl Default for DefaultAttachment {
    fn default() -> DefaultAttachment {
        Self::Inherit
    }
}
/// if this is an imported policy, what is the peer's default binding config for it? 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PeerDefault {
    #[serde(rename = "Attached")]
    Attached,
    #[serde(rename = "NotAttached")]
    NotAttached,
    #[serde(rename = "NoConfiguration")]
    NoConfiguration,
}

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