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
/*
* 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 Allowance {
/// calls the plan allows per period; 0 = unbounded
#[serde(rename = "limit", skip_serializing_if = "Option::is_none")]
pub limit: Option<i32>,
/// the tier the limit came from
#[serde(rename = "plan", skip_serializing_if = "Option::is_none")]
pub plan: Option<String>,
/// unix seconds; when THAT window starts again
#[serde(rename = "resets", skip_serializing_if = "Option::is_none")]
pub resets: Option<i32>,
/// the subject is at the limit
#[serde(rename = "spent", skip_serializing_if = "Option::is_none")]
pub spent: Option<bool>,
/// Used is how many zero-priced calls this subject has been SERVED in the period ending at Resets — the UTC calendar day. Only a served call counts, so an admission check, a refusal, or a vendor that never answered leaves it where it stood. It stops AT Limit rather than climbing past it, so Limit-Used is what remains and never goes negative.
#[serde(rename = "used", skip_serializing_if = "Option::is_none")]
pub used: Option<i32>,
/// Window is which ceiling these numbers describe — \"hour\" or \"day\" — because a caller is held to both and only one of them is the answer. It is the window that REFUSED where one did, and otherwise the one with least left, so Limit-Used is always the number that will actually stop them next. Empty where no window bounds the subject at all.
#[serde(rename = "window", skip_serializing_if = "Option::is_none")]
pub window: Option<String>,
}
impl Allowance {
pub fn new() -> Allowance {
Allowance {
limit: None,
plan: None,
resets: None,
spent: None,
used: None,
window: None,
}
}
}