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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
* 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};
/// NewReadContextConfigRule : Information about what must be done to data when it is read from a capsule
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct NewReadContextConfigRule {
/// A list of expressions referencing the domainIdentity, readParameters and capsule/span tags. Each expression will be ANDed together, and ANDed with the factAssertions to determine if this rule activates.
#[serde(rename = "matchExpressions", skip_serializing_if = "Option::is_none")]
pub match_expressions: Option<Vec<models::ReadContextRuleMatchExpressionsInner>>,
#[serde(rename = "action")]
pub action: Action,
/// if the action 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 action 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>,
/// assert the existence or nonexistence of facts that reference the domainIdentity, tags and readParameters. These assertions will be ANDed together, and ANDed with the matchExpressions
#[serde(rename = "facts", skip_serializing_if = "Option::is_none")]
pub facts: Option<Vec<models::ReadContextRuleFactsInner>>,
/// This rule's priority. Lower priority numbers rules are evaluated first
#[serde(rename = "priority")]
pub priority: i32,
}
impl NewReadContextConfigRule {
/// Information about what must be done to data when it is read from a capsule
pub fn new(action: Action, priority: i32) -> NewReadContextConfigRule {
NewReadContextConfigRule {
match_expressions: None,
action,
token_scope: None,
token_format: None,
facts: None,
priority,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Action {
#[serde(rename = "DenyCapsule")]
DenyCapsule,
#[serde(rename = "DenyRecord")]
DenyRecord,
#[serde(rename = "Redact")]
Redact,
#[serde(rename = "Tokenize")]
Tokenize,
#[serde(rename = "Allow")]
Allow,
}
impl Default for Action {
fn default() -> Action {
Self::DenyCapsule
}
}
/// if the action 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 action 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
}
}