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
101
102
103
104
105
106
107
108
109
110
111
112
/*
* 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 ReportReq {
/// Account is the linked account the window was metered from.
#[serde(rename = "account", skip_serializing_if = "Option::is_none")]
pub account: Option<String>,
/// CachedInputTokens is the prompt tokens the provider served from cache.
#[serde(rename = "cachedInputTokens", skip_serializing_if = "Option::is_none")]
pub cached_input_tokens: Option<i32>,
/// Confidence says how much the counters below mean.
#[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.
#[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.
#[serde(rename = "inputTokens", skip_serializing_if = "Option::is_none")]
pub input_tokens: Option<i32>,
/// Kind is subscription or apikey. Empty is accepted; anything else is refused.
#[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
pub kind: Option<String>,
/// Lane is the meter lane within the account.
#[serde(rename = "lane", skip_serializing_if = "Option::is_none")]
pub lane: Option<String>,
/// Machine is the host whose meter read the window. Required on every sample.
#[serde(rename = "machine", skip_serializing_if = "Option::is_none")]
pub machine: Option<String>,
/// OutputTokens is completion tokens produced in the window.
#[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>,
/// Provider is the upstream the account belongs to, e.g. anthropic. Required on every sample.
#[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
pub provider: Option<String>,
/// Requests is how many requests the window covers.
#[serde(rename = "requests", skip_serializing_if = "Option::is_none")]
pub requests: Option<i32>,
/// ResetsAt is when the measured window rolls over, RFC3339.
#[serde(rename = "resetsAt", skip_serializing_if = "Option::is_none")]
pub resets_at: Option<String>,
/// Samples is the batch form: every lane a poller measured, in one call. When it is non-empty the top-level sample fields are ignored.
#[serde(rename = "samples", skip_serializing_if = "Option::is_none")]
pub samples: Option<Vec<models::SampleReq>>,
/// Synthetic marks a window 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.
#[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. Required, and a class this surface does not know is refused rather than rewritten.
#[serde(rename = "window", skip_serializing_if = "Option::is_none")]
pub window: Option<String>,
/// WindowMinutes is the window's real length in minutes, as the meter reports it.
#[serde(rename = "windowMinutes", skip_serializing_if = "Option::is_none")]
pub window_minutes: Option<i32>,
/// WindowStart is when the measured window opened, RFC3339. This is how a backfill states WHICH window it measured; the server always owns the observation clock, so there is no timestamp field.
#[serde(rename = "windowStart", skip_serializing_if = "Option::is_none")]
pub window_start: Option<String>,
}
impl ReportReq {
pub fn new() -> ReportReq {
ReportReq {
account: None,
cached_input_tokens: None,
confidence: None,
cost_cents: None,
cost_limit_cents: None,
currency: None,
input_tokens: None,
kind: None,
lane: None,
machine: None,
output_tokens: None,
plan: None,
provider: None,
requests: None,
resets_at: None,
samples: None,
synthetic: None,
total_tokens: None,
used_pct: None,
window: None,
window_minutes: None,
window_start: None,
}
}
}