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
/*
* Hanzo Cloud API
*
* The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
*
* The version of the OpenAPI document: v1
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ReferenceAnswer {
/// Age is how old that is, as a duration.
#[serde(rename = "age", skip_serializing_if = "Option::is_none")]
pub age: Option<String>,
/// AsOf is when the oldest contributing publisher was current, RFC 3339.
#[serde(rename = "asOf", skip_serializing_if = "Option::is_none")]
pub as_of: Option<String>,
/// From is override or baseline — which plane answered.
#[serde(rename = "from", skip_serializing_if = "Option::is_none")]
pub from: Option<String>,
/// Hit is whether the key is a member. It is meaningful ONLY when Refusal is empty: false with a refusal means the set could not be consulted, which is not the same as the key being clean.
#[serde(rename = "hit", skip_serializing_if = "Option::is_none")]
pub hit: Option<bool>,
/// Key is the key as asked.
#[serde(rename = "key", skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
/// Matched is the member that covered the key, which for a domain or a network is the enclosing entry rather than the key itself.
#[serde(rename = "matched", skip_serializing_if = "Option::is_none")]
pub matched: Option<String>,
/// Refusal is why the set could not be consulted, when it could not: never loaded, held elsewhere, or a source we hold no licence for. Non-empty means Hit must not be read as an answer.
#[serde(rename = "refusal", skip_serializing_if = "Option::is_none")]
pub refusal: Option<String>,
/// Score is the published risk weight where the source expresses one.
#[serde(rename = "score", skip_serializing_if = "Option::is_none")]
pub score: Option<f64>,
/// Set is the set consulted.
#[serde(rename = "set", skip_serializing_if = "Option::is_none")]
pub set: Option<String>,
/// Stale is whether the set is past its freshness bound. A stale set still answers — yesterday's list beats none — and this is how a decision knows it leaned on one.
#[serde(rename = "stale", skip_serializing_if = "Option::is_none")]
pub stale: Option<bool>,
/// Value is what the publisher says about the member — class, operator, scheme, region.
#[serde(rename = "value", skip_serializing_if = "Option::is_none")]
pub value: Option<std::collections::HashMap<String, String>>,
/// Verdict is the tenant's own allow or deny, present only for an override. The baseline never carries one: it states facts and leaves the decision to the caller's policy.
#[serde(rename = "verdict", skip_serializing_if = "Option::is_none")]
pub verdict: Option<String>,
/// Version is the exact baseline version consulted, composed of each contributing publisher and its content digest. It is what makes a decision reproducible: an auditor takes this string and knows precisely what was consulted.
#[serde(rename = "version", skip_serializing_if = "Option::is_none")]
pub version: Option<String>,
}
impl ReferenceAnswer {
pub fn new() -> ReferenceAnswer {
ReferenceAnswer {
age: None,
as_of: None,
from: None,
hit: None,
key: None,
matched: None,
refusal: None,
score: None,
set: None,
stale: None,
value: None,
verdict: None,
version: None,
}
}
}