hanzo-client 8.5.156

Generated client for the Hanzo API — every service, one crate.
Documentation
/*
 * 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 ReadingReq {
    /// Account is the provider-side account the sample belongs to.
    #[serde(rename = "account", skip_serializing_if = "Option::is_none")]
    pub account: Option<String>,
    /// CachedInputTokens is the window's cached-prompt-token count.
    #[serde(rename = "cachedInputTokens", skip_serializing_if = "Option::is_none")]
    pub cached_input_tokens: Option<i32>,
    /// Confidence says how real the counters are, as the meter graded itself.
    #[serde(rename = "confidence", skip_serializing_if = "Option::is_none")]
    pub confidence: Option<String>,
    /// CostCents is the window's spend in cents, as the provider's meter states it.
    #[serde(rename = "costCents", skip_serializing_if = "Option::is_none")]
    pub cost_cents: Option<i32>,
    /// CostLimitCents is the window's spend cap in cents, when the meter knows one.
    #[serde(rename = "costLimitCents", skip_serializing_if = "Option::is_none")]
    pub cost_limit_cents: Option<i32>,
    /// Currency is the ISO currency the cost fields are stated in.
    #[serde(rename = "currency", skip_serializing_if = "Option::is_none")]
    pub currency: Option<String>,
    /// InputTokens is the window's prompt-token count.
    #[serde(rename = "inputTokens", skip_serializing_if = "Option::is_none")]
    pub input_tokens: Option<i32>,
    /// Kind is subscription or apikey; anything else is refused.
    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
    pub kind: Option<String>,
    /// Lane names the meter's own lane label for this measurement.
    #[serde(rename = "lane", skip_serializing_if = "Option::is_none")]
    pub lane: Option<String>,
    /// Machine is the machine the collector observed the account on. Required.
    #[serde(rename = "machine", skip_serializing_if = "Option::is_none")]
    pub machine: Option<String>,
    /// OutputTokens is the window's completion-token count.
    #[serde(rename = "outputTokens", skip_serializing_if = "Option::is_none")]
    pub output_tokens: Option<i32>,
    /// Plan is the provider plan label the account is on.
    #[serde(rename = "plan", skip_serializing_if = "Option::is_none")]
    pub plan: Option<String>,
    /// Provider is the AI provider whose meter reported this sample. Required.
    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
    pub provider: Option<String>,
    /// Requests is the window's request count.
    #[serde(rename = "requests", skip_serializing_if = "Option::is_none")]
    pub requests: Option<i32>,
    /// ResetsAt is when the window resets, RFC 3339, bounded.
    #[serde(rename = "resetsAt", skip_serializing_if = "Option::is_none")]
    pub resets_at: Option<String>,
    /// Synthetic marks a sample the collector derived rather than observed.
    #[serde(rename = "synthetic", skip_serializing_if = "Option::is_none")]
    pub synthetic: Option<bool>,
    /// TotalTokens is the window's total token count.
    #[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, clamped 0..100.
    #[serde(rename = "usedPct", skip_serializing_if = "Option::is_none")]
    pub used_pct: Option<f64>,
    /// Window is the window class, one of 6h, day, week, month; anything else is refused rather than silently reclassified.
    #[serde(rename = "window", skip_serializing_if = "Option::is_none")]
    pub window: Option<String>,
    /// WindowMinutes is the window's length as the meter reported it.
    #[serde(rename = "windowMinutes", skip_serializing_if = "Option::is_none")]
    pub window_minutes: Option<i32>,
    /// WindowStart is when the measured window opened, RFC 3339, bounded to a sane interval around now.
    #[serde(rename = "windowStart", skip_serializing_if = "Option::is_none")]
    pub window_start: Option<String>,
}

impl ReadingReq {
    pub fn new() -> ReadingReq {
        ReadingReq {
            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,
            synthetic: None,
            total_tokens: None,
            used_pct: None,
            window: None,
            window_minutes: None,
            window_start: None,
        }
    }
}