Skip to main content

hanzo_client/models/
usage_window_view.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 UsageWindowView {
16    /// Account is the linked provider account the window belongs to.
17    #[serde(rename = "account", skip_serializing_if = "Option::is_none")]
18    pub account: Option<String>,
19    /// CachedInputTokens is the prompt tokens served from the provider's cache; omitted when unknown.
20    #[serde(rename = "cachedInputTokens", skip_serializing_if = "Option::is_none")]
21    pub cached_input_tokens: Option<i32>,
22    /// 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.
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. It is not a Hanzo charge.
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; omitted when unknown.
35    #[serde(rename = "inputTokens", skip_serializing_if = "Option::is_none")]
36    pub input_tokens: Option<i32>,
37    /// Lane is the meter lane this instance belongs to, e.g. a provider's own rolling-window meter.
38    #[serde(rename = "lane", skip_serializing_if = "Option::is_none")]
39    pub lane: Option<String>,
40    /// Machine is the host whose meter reported the window.
41    #[serde(rename = "machine", skip_serializing_if = "Option::is_none")]
42    pub machine: Option<String>,
43    /// OutputTokens is completion tokens produced in the window; omitted when unknown.
44    #[serde(rename = "outputTokens", skip_serializing_if = "Option::is_none")]
45    pub output_tokens: Option<i32>,
46    /// Plan is the subscription plan the account is on, as the provider names it.
47    #[serde(rename = "plan", skip_serializing_if = "Option::is_none")]
48    pub plan: Option<String>,
49    /// Requests is how many requests were made in the window; omitted when the meter did not report it.
50    #[serde(rename = "requests", skip_serializing_if = "Option::is_none")]
51    pub requests: Option<i32>,
52    /// ResetsAt is when this window rolls over, RFC3339 UTC; omitted when unknown.
53    #[serde(rename = "resetsAt", skip_serializing_if = "Option::is_none")]
54    pub resets_at: Option<String>,
55    /// Synthetic marks an instance the meter inferred rather than read.
56    #[serde(rename = "synthetic", skip_serializing_if = "Option::is_none")]
57    pub synthetic: Option<bool>,
58    /// TotalTokens is the window's total tokens; omitted when unknown.
59    #[serde(rename = "totalTokens", skip_serializing_if = "Option::is_none")]
60    pub total_tokens: Option<i32>,
61    /// UsedPct is how much of the window's allowance is consumed, 0–100.
62    #[serde(rename = "usedPct", skip_serializing_if = "Option::is_none")]
63    pub used_pct: Option<f64>,
64    /// Window is the window class: 6h, day, week or month.
65    #[serde(rename = "window", skip_serializing_if = "Option::is_none")]
66    pub window: Option<String>,
67    /// WindowMinutes is the window's real length in minutes when the meter reported one; omitted when it did not.
68    #[serde(rename = "windowMinutes", skip_serializing_if = "Option::is_none")]
69    pub window_minutes: Option<i32>,
70    /// WindowStart is when this window opened, RFC3339 UTC; omitted when unknown.
71    #[serde(rename = "windowStart", skip_serializing_if = "Option::is_none")]
72    pub window_start: Option<String>,
73}
74
75impl UsageWindowView {
76    pub fn new() -> UsageWindowView {
77        UsageWindowView {
78            account: None,
79            cached_input_tokens: None,
80            confidence: None,
81            cost_cents: None,
82            cost_limit_cents: None,
83            currency: None,
84            input_tokens: None,
85            lane: None,
86            machine: None,
87            output_tokens: None,
88            plan: None,
89            requests: None,
90            resets_at: None,
91            synthetic: None,
92            total_tokens: None,
93            used_pct: None,
94            window: None,
95            window_minutes: None,
96            window_start: None,
97        }
98    }
99}
100