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 ReadContextRuleMatchExpressionsInner {
    #[serde(rename = "source")]
    pub source: Source,
    #[serde(rename = "key")]
    pub key: String,
    /// What to do with the value identified by `key`. In and NotIn compare with `values`, DateDeltaLessThan and DateDeltaGreaterThan treat the value as an RFC3339 date, and measure if the `now()-date` is less than or greater than the time span expressed in `value`. 
    #[serde(rename = "operator")]
    pub operator: Operator,
    /// to be used with In and NotIn operators
    #[serde(rename = "values", skip_serializing_if = "Option::is_none")]
    pub values: Option<Vec<String>>,
    /// To be used with DateDelta operators. A time span in `23d4h5m32s` notation. It does not support interval shorthands greater than a day, so to express 3 months, for example, use `90d`. Positive time spans indicate the date appeared in the past. Negative time spans indicate the date appears in the future. 
    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
}

impl ReadContextRuleMatchExpressionsInner {
    pub fn new(source: Source, key: String, operator: Operator) -> ReadContextRuleMatchExpressionsInner {
        ReadContextRuleMatchExpressionsInner {
            source,
            key,
            operator,
            values: None,
            value: None,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Source {
    #[serde(rename = "domainIdentity")]
    DomainIdentity,
    #[serde(rename = "readParameters")]
    ReadParameters,
    #[serde(rename = "tags")]
    Tags,
}

impl Default for Source {
    fn default() -> Source {
        Self::DomainIdentity
    }
}
/// What to do with the value identified by `key`. In and NotIn compare with `values`, DateDeltaLessThan and DateDeltaGreaterThan treat the value as an RFC3339 date, and measure if the `now()-date` is less than or greater than the time span expressed in `value`. 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Operator {
    #[serde(rename = "In")]
    In,
    #[serde(rename = "NotIn")]
    NotIn,
    #[serde(rename = "Exists")]
    Exists,
    #[serde(rename = "NotExists")]
    NotExists,
    #[serde(rename = "DateDeltaLessThan")]
    DateDeltaLessThan,
    #[serde(rename = "DateDeltaGreaterThan")]
    DateDeltaGreaterThan,
}

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