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
/*
* 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};
/// DomainPolicyRule : A rule governing the domain's policy. All domain identity capabilities must match (AND) for the action to take effect. If the domainIdentity or facts sections are omitted, they match all domain identities and any fact configurations respectively.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DomainPolicyRule {
/// An identifier for a domain policy rule that might be imported from a peer domain. If it is, it will bear an imported resource prefix (either a domain identifier or an alias, followed by ::)
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "domainIdentity", skip_serializing_if = "Option::is_none")]
pub domain_identity: Option<Box<models::CapabilityRule>>,
/// assert the existence or nonexistence of facts that reference the domainIdentity. These assertions will be ANDed together, and ANDed with the domainIdentity expression
#[serde(rename = "facts", skip_serializing_if = "Option::is_none")]
pub facts: Option<Vec<models::FactPolicyRulesInner>>,
/// the path this rule governs. This pattern may contain glob expressions (e.g. '*' and '**').
#[serde(rename = "path")]
pub path: String,
#[serde(rename = "operation")]
pub operation: models::PolicyRuleOperation,
#[serde(rename = "result")]
pub result: models::PolicyRuleResult,
/// This rule's priority. Lower priority numbers rules are evaluated first
#[serde(rename = "priority")]
pub priority: i32,
/// If this rule is disabled or not.
#[serde(rename = "disabled")]
pub disabled: bool,
/// true if this write context 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>,
/// for imported rules, whether this rule is evaluated before (<0) or after (>0) the current domain's rules. Always 0 for non-imported rules
#[serde(rename = "precedence")]
pub precedence: i32,
/// If the rule was created referencing a resource that was valid at the time of the rule's creation, but has since become invalid (e.g. if it was a peered resource and the peering has changed) then the rule will be ignored during policy evaluation, and \"invalid\" will be true when listing the domain policy rules
#[serde(rename = "invalid", skip_serializing_if = "Option::is_none")]
pub invalid: Option<bool>,
}
impl DomainPolicyRule {
/// A rule governing the domain's policy. All domain identity capabilities must match (AND) for the action to take effect. If the domainIdentity or facts sections are omitted, they match all domain identities and any fact configurations respectively.
pub fn new(id: String, path: String, operation: models::PolicyRuleOperation, result: models::PolicyRuleResult, priority: i32, disabled: bool, imported: bool, precedence: i32) -> DomainPolicyRule {
DomainPolicyRule {
id,
domain_identity: None,
facts: None,
path,
operation,
result,
priority,
disabled,
imported,
source_domain_id: None,
source_domain_name: None,
precedence,
invalid: None,
}
}
}