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
/*
* 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 TrafficView {
/// Blind is how many requests in the window carried no identity to attribute them to — no validated credential and no client address. Non-zero on a public plane means the client address is not reaching this process (a TCP load balancer with no PROXY protocol in front of it, typically), so this scope's callers cannot be told apart and nothing can be held against them.
#[serde(rename = "blind", skip_serializing_if = "Option::is_none")]
pub blind: Option<i32>,
/// Callers is the scope's busiest callers this window. A credentialed caller appears as a FINGERPRINT — a per-process one-way digest: enough to recognise the same caller across requests, never enough to reconstruct the credential.
#[serde(rename = "callers", skip_serializing_if = "Option::is_none")]
pub callers: Option<Vec<models::TrafficCaller>>,
/// Ceiling is the most callers this scope may hold at once.
#[serde(rename = "ceiling", skip_serializing_if = "Option::is_none")]
pub ceiling: Option<i32>,
/// Denied is how many of them the gate refused.
#[serde(rename = "denied", skip_serializing_if = "Option::is_none")]
pub denied: Option<i32>,
/// Lanes is the request count per lane — agent, human, bot, unknown. This is the split that separates a customer's automation from a scraper.
#[serde(rename = "lanes", skip_serializing_if = "Option::is_none")]
pub lanes: Option<std::collections::HashMap<String, i32>>,
/// Mode is the abuse gate's posture for this scope: \"shadow\" records the scorer's action without enforcing it, \"live\" enforces it.
#[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
pub mode: Option<String>,
/// Org is the scope this view was taken for — the validated principal's own, never a value the caller supplied. Empty names the anonymous lane, the one scope that has no tenant.
#[serde(rename = "org", skip_serializing_if = "Option::is_none")]
pub org: Option<String>,
/// Refused is how many callers this scope's ceilings turned away in the window.
#[serde(rename = "refused", skip_serializing_if = "Option::is_none")]
pub refused: Option<i32>,
/// Requests is how many requests this scope made in the window.
#[serde(rename = "requests", skip_serializing_if = "Option::is_none")]
pub requests: Option<i32>,
/// Screens is how many of them were put to the scorer — the billable unit of the risk product. Counted from the first request, whatever the SKU costs.
#[serde(rename = "screens", skip_serializing_if = "Option::is_none")]
pub screens: Option<i32>,
/// Strain is what this scope's ceilings are doing: \"clear\" below them, \"full\" at them, \"refuse\" once a caller has been turned away inside this window — which means that caller is UNMEASURED and the numbers here are a sample rather than a census. It is reported rather than logged because the alternative — a bound that degrades a scope silently — is the failure this design exists to rule out. No other scope can move it.
#[serde(rename = "strain", skip_serializing_if = "Option::is_none")]
pub strain: Option<String>,
/// Tracked is how many callers this scope holds state for right now, and Ceiling is the most it may hold. Tracked == Ceiling is the fact a bound that binds cannot hide.
#[serde(rename = "tracked", skip_serializing_if = "Option::is_none")]
pub tracked: Option<i32>,
/// Unscored is how many of those screens got NO answer — the scorer was absent, stuck, slow, erroring or silent. An unanswered screen allows ordinary traffic, so this is the number that separates \"a quiet day\" from \"the judge stopped answering and nothing said so\".
#[serde(rename = "unscored", skip_serializing_if = "Option::is_none")]
pub unscored: Option<i32>,
/// WindowSec is the span the counts cover, in seconds.
#[serde(rename = "window_sec", skip_serializing_if = "Option::is_none")]
pub window_sec: Option<i32>,
}
impl TrafficView {
pub fn new() -> TrafficView {
TrafficView {
blind: None,
callers: None,
ceiling: None,
denied: None,
lanes: None,
mode: None,
org: None,
refused: None,
requests: None,
screens: None,
strain: None,
tracked: None,
unscored: None,
window_sec: None,
}
}
}