Skip to main content

hanzo_client/models/
report_req.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 ReportReq {
16    /// Account is the linked account the window was metered from.
17    #[serde(rename = "account", skip_serializing_if = "Option::is_none")]
18    pub account: Option<String>,
19    /// CachedInputTokens is the prompt tokens the provider served from cache.
20    #[serde(rename = "cachedInputTokens", skip_serializing_if = "Option::is_none")]
21    pub cached_input_tokens: Option<i32>,
22    /// Confidence says how much the counters below mean.
23    #[serde(rename = "confidence", skip_serializing_if = "Option::is_none")]
24    pub confidence: Option<String>,
25    /// CostCents is what the window cost on the PROVIDER's own plan, in US cents.
26    #[serde(rename = "costCents", skip_serializing_if = "Option::is_none")]
27    pub cost_cents: Option<i32>,
28    /// CostLimitCents is the plan's spend ceiling for the window, in US cents.
29    #[serde(rename = "costLimitCents", skip_serializing_if = "Option::is_none")]
30    pub cost_limit_cents: Option<i32>,
31    /// Currency is the provider's currency when it is not US cents.
32    #[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
33    pub currency: Option<String>,
34    /// InputTokens is prompt tokens consumed in the window.
35    #[serde(rename = "inputTokens", skip_serializing_if = "Option::is_none")]
36    pub input_tokens: Option<i32>,
37    /// Kind is subscription or apikey. Empty is accepted; anything else is refused.
38    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
39    pub kind: Option<String>,
40    /// Lane is the meter lane within the account.
41    #[serde(rename = "lane", skip_serializing_if = "Option::is_none")]
42    pub lane: Option<String>,
43    /// Machine is the host whose meter read the window. Required on every sample.
44    #[serde(rename = "machine", skip_serializing_if = "Option::is_none")]
45    pub machine: Option<String>,
46    /// OutputTokens is completion tokens produced in the window.
47    #[serde(rename = "outputTokens", skip_serializing_if = "Option::is_none")]
48    pub output_tokens: Option<i32>,
49    /// Plan is the subscription plan the account is on, as the provider names it.
50    #[serde(rename = "plan", skip_serializing_if = "Option::is_none")]
51    pub plan: Option<String>,
52    /// Provider is the upstream the account belongs to, e.g. anthropic. Required on every sample.
53    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
54    pub provider: Option<String>,
55    /// Requests is how many requests the window covers.
56    #[serde(rename = "requests", skip_serializing_if = "Option::is_none")]
57    pub requests: Option<i32>,
58    /// ResetsAt is when the measured window rolls over, RFC3339.
59    #[serde(rename = "resetsAt", skip_serializing_if = "Option::is_none")]
60    pub resets_at: Option<String>,
61    /// 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.
62    #[serde(rename = "samples", skip_serializing_if = "Option::is_none")]
63    pub samples: Option<Vec<models::SampleReq>>,
64    /// Synthetic marks a window the meter inferred rather than read.
65    #[serde(rename = "synthetic", skip_serializing_if = "Option::is_none")]
66    pub synthetic: Option<bool>,
67    /// TotalTokens is the window's total tokens.
68    #[serde(rename = "totalTokens", skip_serializing_if = "Option::is_none")]
69    pub total_tokens: Option<i32>,
70    /// UsedPct is how much of the window's allowance is consumed, 0–100.
71    #[serde(rename = "usedPct", skip_serializing_if = "Option::is_none")]
72    pub used_pct: Option<f64>,
73    /// Window is the window class: 6h, day, week or month. Required, and a class this surface does not know is refused rather than rewritten.
74    #[serde(rename = "window", skip_serializing_if = "Option::is_none")]
75    pub window: Option<String>,
76    /// WindowMinutes is the window's real length in minutes, as the meter reports it.
77    #[serde(rename = "windowMinutes", skip_serializing_if = "Option::is_none")]
78    pub window_minutes: Option<i32>,
79    /// 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.
80    #[serde(rename = "windowStart", skip_serializing_if = "Option::is_none")]
81    pub window_start: Option<String>,
82}
83
84impl ReportReq {
85    pub fn new() -> ReportReq {
86        ReportReq {
87            account: None,
88            cached_input_tokens: None,
89            confidence: None,
90            cost_cents: None,
91            cost_limit_cents: None,
92            currency: None,
93            input_tokens: None,
94            kind: None,
95            lane: None,
96            machine: None,
97            output_tokens: None,
98            plan: None,
99            provider: None,
100            requests: None,
101            resets_at: None,
102            samples: None,
103            synthetic: None,
104            total_tokens: None,
105            used_pct: None,
106            window: None,
107            window_minutes: None,
108            window_start: None,
109        }
110    }
111}
112