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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
* 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 UsageWindowView {
/// Account is the linked provider account the window belongs to.
#[serde(rename = "account", skip_serializing_if = "Option::is_none")]
pub account: Option<String>,
/// CachedInputTokens is the prompt tokens served from the provider's cache; omitted when unknown.
#[serde(rename = "cachedInputTokens", skip_serializing_if = "Option::is_none")]
pub cached_input_tokens: Option<i32>,
/// Confidence says how much the counters beside it mean — a meter that reported only a percentage leaves them at zero, and this is how a reader tells that from a true zero.
#[serde(rename = "confidence", skip_serializing_if = "Option::is_none")]
pub confidence: Option<String>,
/// CostCents is what the window cost on the PROVIDER's own plan, in US cents. It is not a Hanzo charge.
#[serde(rename = "costCents", skip_serializing_if = "Option::is_none")]
pub cost_cents: Option<i32>,
/// CostLimitCents is the plan's spend ceiling for the window, in US cents.
#[serde(rename = "costLimitCents", skip_serializing_if = "Option::is_none")]
pub cost_limit_cents: Option<i32>,
/// Currency is the provider's currency when it is not US cents.
#[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
pub currency: Option<String>,
/// InputTokens is prompt tokens consumed in the window; omitted when unknown.
#[serde(rename = "inputTokens", skip_serializing_if = "Option::is_none")]
pub input_tokens: Option<i32>,
/// Lane is the meter lane this instance belongs to, e.g. a provider's own rolling-window meter.
#[serde(rename = "lane", skip_serializing_if = "Option::is_none")]
pub lane: Option<String>,
/// Machine is the host whose meter reported the window.
#[serde(rename = "machine", skip_serializing_if = "Option::is_none")]
pub machine: Option<String>,
/// OutputTokens is completion tokens produced in the window; omitted when unknown.
#[serde(rename = "outputTokens", skip_serializing_if = "Option::is_none")]
pub output_tokens: Option<i32>,
/// Plan is the subscription plan the account is on, as the provider names it.
#[serde(rename = "plan", skip_serializing_if = "Option::is_none")]
pub plan: Option<String>,
/// Requests is how many requests were made in the window; omitted when the meter did not report it.
#[serde(rename = "requests", skip_serializing_if = "Option::is_none")]
pub requests: Option<i32>,
/// ResetsAt is when this window rolls over, RFC3339 UTC; omitted when unknown.
#[serde(rename = "resetsAt", skip_serializing_if = "Option::is_none")]
pub resets_at: Option<String>,
/// Synthetic marks an instance the meter inferred rather than read.
#[serde(rename = "synthetic", skip_serializing_if = "Option::is_none")]
pub synthetic: Option<bool>,
/// TotalTokens is the window's total tokens; omitted when unknown.
#[serde(rename = "totalTokens", skip_serializing_if = "Option::is_none")]
pub total_tokens: Option<i32>,
/// UsedPct is how much of the window's allowance is consumed, 0–100.
#[serde(rename = "usedPct", skip_serializing_if = "Option::is_none")]
pub used_pct: Option<f64>,
/// Window is the window class: 6h, day, week or month.
#[serde(rename = "window", skip_serializing_if = "Option::is_none")]
pub window: Option<String>,
/// WindowMinutes is the window's real length in minutes when the meter reported one; omitted when it did not.
#[serde(rename = "windowMinutes", skip_serializing_if = "Option::is_none")]
pub window_minutes: Option<i32>,
/// WindowStart is when this window opened, RFC3339 UTC; omitted when unknown.
#[serde(rename = "windowStart", skip_serializing_if = "Option::is_none")]
pub window_start: Option<String>,
}
impl UsageWindowView {
pub fn new() -> UsageWindowView {
UsageWindowView {
account: None,
cached_input_tokens: None,
confidence: None,
cost_cents: None,
cost_limit_cents: None,
currency: None,
input_tokens: None,
lane: None,
machine: None,
output_tokens: None,
plan: None,
requests: None,
resets_at: None,
synthetic: None,
total_tokens: None,
used_pct: None,
window: None,
window_minutes: None,
window_start: None,
}
}
}