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 DataPolicyRule {
    /// An identifier for a rule
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "comment")]
    pub comment: String,
    #[serde(rename = "clauses")]
    pub clauses: Vec<models::DataPolicyClause>,
    #[serde(rename = "effect")]
    pub effect: models::DataPolicyRuleEffect,
    /// if the effect is Tokenize, what scope to use for the token 
    #[serde(rename = "tokenScope", skip_serializing_if = "Option::is_none")]
    pub token_scope: Option<TokenScope>,
    /// if the effect is Tokenize, what format should the token take. Explicit is of the form tk-xxxxxx and synthetic returns something that looks like the original data type (e.g. John Smith for a name) but is in fact a token 
    #[serde(rename = "tokenFormat", skip_serializing_if = "Option::is_none")]
    pub token_format: Option<TokenFormat>,
    /// This rule's priority. Lower priority numbers rules are evaluated first
    #[serde(rename = "priority")]
    pub priority: i32,
}

impl DataPolicyRule {
    pub fn new(id: String, comment: String, clauses: Vec<models::DataPolicyClause>, effect: models::DataPolicyRuleEffect, priority: i32) -> DataPolicyRule {
        DataPolicyRule {
            id,
            comment,
            clauses,
            effect,
            token_scope: None,
            token_format: None,
            priority,
        }
    }
}
/// if the effect is Tokenize, what scope to use for the token 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TokenScope {
    #[serde(rename = "unique")]
    Unique,
    #[serde(rename = "capsule")]
    Capsule,
    #[serde(rename = "domain")]
    Domain,
}

impl Default for TokenScope {
    fn default() -> TokenScope {
        Self::Unique
    }
}
/// if the effect is Tokenize, what format should the token take. Explicit is of the form tk-xxxxxx and synthetic returns something that looks like the original data type (e.g. John Smith for a name) but is in fact a token 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum TokenFormat {
    #[serde(rename = "explicit")]
    Explicit,
    #[serde(rename = "synthetic")]
    Synthetic,
}

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