Skip to main content

hanzo_client/models/
reference_answer.rs

1/*
2 * Hanzo Cloud API
3 *
4 * 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/.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ReferenceAnswer {
16    /// Age is how old that is, as a duration.
17    #[serde(rename = "age", skip_serializing_if = "Option::is_none")]
18    pub age: Option<String>,
19    /// AsOf is when the oldest contributing publisher was current, RFC 3339.
20    #[serde(rename = "asOf", skip_serializing_if = "Option::is_none")]
21    pub as_of: Option<String>,
22    /// From is override or baseline — which plane answered.
23    #[serde(rename = "from", skip_serializing_if = "Option::is_none")]
24    pub from: Option<String>,
25    /// 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.
26    #[serde(rename = "hit", skip_serializing_if = "Option::is_none")]
27    pub hit: Option<bool>,
28    /// Key is the key as asked.
29    #[serde(rename = "key", skip_serializing_if = "Option::is_none")]
30    pub key: Option<String>,
31    /// Matched is the member that covered the key, which for a domain or a network is the enclosing entry rather than the key itself.
32    #[serde(rename = "matched", skip_serializing_if = "Option::is_none")]
33    pub matched: Option<String>,
34    /// 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.
35    #[serde(rename = "refusal", skip_serializing_if = "Option::is_none")]
36    pub refusal: Option<String>,
37    /// Score is the published risk weight where the source expresses one.
38    #[serde(rename = "score", skip_serializing_if = "Option::is_none")]
39    pub score: Option<f64>,
40    /// Set is the set consulted.
41    #[serde(rename = "set", skip_serializing_if = "Option::is_none")]
42    pub set: Option<String>,
43    /// 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.
44    #[serde(rename = "stale", skip_serializing_if = "Option::is_none")]
45    pub stale: Option<bool>,
46    /// Value is what the publisher says about the member — class, operator, scheme, region.
47    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
48    pub value: Option<std::collections::HashMap<String, String>>,
49    /// 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.
50    #[serde(rename = "verdict", skip_serializing_if = "Option::is_none")]
51    pub verdict: Option<String>,
52    /// 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.
53    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
54    pub version: Option<String>,
55}
56
57impl ReferenceAnswer {
58    pub fn new() -> ReferenceAnswer {
59        ReferenceAnswer {
60            age: None,
61            as_of: None,
62            from: None,
63            hit: None,
64            key: None,
65            matched: None,
66            refusal: None,
67            score: None,
68            set: None,
69            stale: None,
70            value: None,
71            verdict: None,
72            version: None,
73        }
74    }
75}
76