1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
* 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
}
}