Skip to main content

hanzo_client/models/
sample_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 SampleReq {
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.
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.
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. Empty is allowed; anything else that is not RFC3339 is refused.
59    #[serde(rename = "resetsAt", skip_serializing_if = "Option::is_none")]
60    pub resets_at: Option<String>,
61    /// Synthetic marks a window the meter inferred rather than read.
62    #[serde(rename = "synthetic", skip_serializing_if = "Option::is_none")]
63    pub synthetic: Option<bool>,
64    /// TotalTokens is the window's total tokens.
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, 0–100.
68    #[serde(rename = "usedPct", skip_serializing_if = "Option::is_none")]
69    pub used_pct: Option<f64>,
70    /// Window is the window class: 6h, day, week or month. Required, and a class this surface does not know is refused rather than rewritten.
71    #[serde(rename = "window", skip_serializing_if = "Option::is_none")]
72    pub window: Option<String>,
73    /// WindowMinutes is the window's real length in minutes, as the meter reports 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, RFC3339. Empty is allowed; anything else that is not RFC3339 is refused.
77    #[serde(rename = "windowStart", skip_serializing_if = "Option::is_none")]
78    pub window_start: Option<String>,
79}
80
81impl SampleReq {
82    pub fn new() -> SampleReq {
83        SampleReq {
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