Skip to main content

hanzo_client/models/
reading_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 ReadingReq {
16    /// Account is the provider-side account the sample belongs to.
17    #[serde(rename = "account", skip_serializing_if = "Option::is_none")]
18    pub account: Option<String>,
19    /// CachedInputTokens is the window's cached-prompt-token count.
20    #[serde(rename = "cachedInputTokens", skip_serializing_if = "Option::is_none")]
21    pub cached_input_tokens: Option<i32>,
22    /// Confidence says how real the counters are, as the meter graded itself.
23    #[serde(rename = "confidence", skip_serializing_if = "Option::is_none")]
24    pub confidence: Option<String>,
25    /// CostCents is the window's spend in cents, as the provider's meter states it.
26    #[serde(rename = "costCents", skip_serializing_if = "Option::is_none")]
27    pub cost_cents: Option<i32>,
28    /// CostLimitCents is the window's spend cap in cents, when the meter knows one.
29    #[serde(rename = "costLimitCents", skip_serializing_if = "Option::is_none")]
30    pub cost_limit_cents: Option<i32>,
31    /// Currency is the ISO currency the cost fields are stated in.
32    #[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
33    pub currency: Option<String>,
34    /// InputTokens is the window's prompt-token count.
35    #[serde(rename = "inputTokens", skip_serializing_if = "Option::is_none")]
36    pub input_tokens: Option<i32>,
37    /// Kind is subscription or apikey; anything else is refused.
38    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
39    pub kind: Option<String>,
40    /// Lane names the meter's own lane label for this measurement.
41    #[serde(rename = "lane", skip_serializing_if = "Option::is_none")]
42    pub lane: Option<String>,
43    /// Machine is the machine the collector observed the account on. Required.
44    #[serde(rename = "machine", skip_serializing_if = "Option::is_none")]
45    pub machine: Option<String>,
46    /// OutputTokens is the window's completion-token count.
47    #[serde(rename = "outputTokens", skip_serializing_if = "Option::is_none")]
48    pub output_tokens: Option<i32>,
49    /// Plan is the provider plan label the account is on.
50    #[serde(rename = "plan", skip_serializing_if = "Option::is_none")]
51    pub plan: Option<String>,
52    /// Provider is the AI provider whose meter reported this sample. Required.
53    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
54    pub provider: Option<String>,
55    /// Requests is the window's request count.
56    #[serde(rename = "requests", skip_serializing_if = "Option::is_none")]
57    pub requests: Option<i32>,
58    /// ResetsAt is when the window resets, RFC 3339, bounded.
59    #[serde(rename = "resetsAt", skip_serializing_if = "Option::is_none")]
60    pub resets_at: Option<String>,
61    /// Synthetic marks a sample the collector derived rather than observed.
62    #[serde(rename = "synthetic", skip_serializing_if = "Option::is_none")]
63    pub synthetic: Option<bool>,
64    /// TotalTokens is the window's total token count.
65    #[serde(rename = "totalTokens", skip_serializing_if = "Option::is_none")]
66    pub total_tokens: Option<i32>,
67    /// UsedPct is how much of the window's allowance is consumed, clamped 0..100.
68    #[serde(rename = "usedPct", skip_serializing_if = "Option::is_none")]
69    pub used_pct: Option<f64>,
70    /// Window is the window class, one of 6h, day, week, month; anything else is refused rather than silently reclassified.
71    #[serde(rename = "window", skip_serializing_if = "Option::is_none")]
72    pub window: Option<String>,
73    /// WindowMinutes is the window's length as the meter reported it.
74    #[serde(rename = "windowMinutes", skip_serializing_if = "Option::is_none")]
75    pub window_minutes: Option<i32>,
76    /// WindowStart is when the measured window opened, RFC 3339, bounded to a sane interval around now.
77    #[serde(rename = "windowStart", skip_serializing_if = "Option::is_none")]
78    pub window_start: Option<String>,
79}
80
81impl ReadingReq {
82    pub fn new() -> ReadingReq {
83        ReadingReq {
84            account: None,
85            cached_input_tokens: None,
86            confidence: None,
87            cost_cents: None,
88            cost_limit_cents: None,
89            currency: None,
90            input_tokens: None,
91            kind: None,
92            lane: None,
93            machine: None,
94            output_tokens: None,
95            plan: None,
96            provider: None,
97            requests: None,
98            resets_at: None,
99            synthetic: None,
100            total_tokens: None,
101            used_pct: None,
102            window: None,
103            window_minutes: None,
104            window_start: None,
105        }
106    }
107}
108