Skip to main content

hanzo_client/models/
link_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 LinkView {
16    /// Account is the provider-side account identifier, when the collector knows it.
17    #[serde(rename = "account", skip_serializing_if = "Option::is_none")]
18    pub account: Option<String>,
19    /// Billing is how this account's inference bills — plan (the user's own subscription, metered here for visibility only) or commerce (the gateway path). Derived from Kind, never stored.
20    #[serde(rename = "billing", skip_serializing_if = "Option::is_none")]
21    pub billing: Option<String>,
22    /// CreatedAt is when the link was first registered, RFC 3339 UTC.
23    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
24    pub created_at: Option<String>,
25    /// Host is the machine's human hostname label, from its most recent report.
26    #[serde(rename = "host", skip_serializing_if = "Option::is_none")]
27    pub host: Option<String>,
28    /// ID is the link's opaque handle (\"link_\" + 32 hex chars).
29    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
30    pub id: Option<String>,
31    /// Kind is how the account authenticates: subscription or apikey.
32    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
33    pub kind: Option<String>,
34    /// LastSeen is when the account last reported, RFC 3339 UTC.
35    #[serde(rename = "lastSeen", skip_serializing_if = "Option::is_none")]
36    pub last_seen: Option<String>,
37    /// Machine is the stable machine identifier the collector reports.
38    #[serde(rename = "machine", skip_serializing_if = "Option::is_none")]
39    pub machine: Option<String>,
40    /// OS is the machine's operating system label.
41    #[serde(rename = "os", skip_serializing_if = "Option::is_none")]
42    pub os: Option<String>,
43    /// Plan is the provider plan label (e.g. \"Claude Max\").
44    #[serde(rename = "plan", skip_serializing_if = "Option::is_none")]
45    pub plan: Option<String>,
46    /// Provider is the AI provider this account belongs to (claude, openai, hanzo…).
47    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
48    pub provider: Option<String>,
49    /// Status is linked or revoked. Revoked rows are retained for history.
50    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
51    pub status: Option<String>,
52    /// UpdatedAt is when the link was last refreshed, RFC 3339 UTC.
53    #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
54    pub updated_at: Option<String>,
55    #[serde(rename = "usage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
56    pub usage: Option<Option<serde_json::Value>>,
57    /// User is the owning subject — the validated caller who registered the link.
58    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
59    pub user: Option<String>,
60}
61
62impl LinkView {
63    pub fn new() -> LinkView {
64        LinkView {
65            account: None,
66            billing: None,
67            created_at: None,
68            host: None,
69            id: None,
70            kind: None,
71            last_seen: None,
72            machine: None,
73            os: None,
74            plan: None,
75            provider: None,
76            status: None,
77            updated_at: None,
78            usage: None,
79            user: None,
80        }
81    }
82}
83