Skip to main content

hanzo_client/models/
event_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 EventView {
16    /// Actor is who produced the turn. A write that names nobody takes the calling principal, so this is rarely empty in practice.
17    #[serde(rename = "actor", skip_serializing_if = "Option::is_none")]
18    pub actor: Option<String>,
19    /// CreatedAt is when the turn was recorded, RFC 3339 in UTC to the second. Seconds are coarse enough that two turns can share one, which is why Seq and not this is the order.
20    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
21    pub created_at: Option<String>,
22    /// ID is the event's own handle, minted as \"evt_\" + 32 hex characters. It identifies the turn; Seq is what ORDERS it.
23    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
24    pub id: Option<String>,
25    /// Kind is what the turn IS, from a closed six: message (a model turn), tool-call, spawn (a subagent started), log, status, control (a steering command the running surface consumes). Anything else is refused at the write.
26    #[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
27    pub kind: Option<String>,
28    #[serde(rename = "payload", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub payload: Option<Option<serde_json::Value>>,
30    /// Seq is the turn's position in this session's log: monotonic from 1, assigned by the store inside the insert, and unique PER SESSION rather than globally. It is the cursor a reader resumes from after a reconnect — ask for everything after your last-seen seq.
31    #[serde(rename = "seq", skip_serializing_if = "Option::is_none")]
32    pub seq: Option<i32>,
33    /// SessionID is the session this turn belongs to. Carried on every event so a stream frame stands alone — a subscriber watching a whole tree gets turns from several sessions down one connection.
34    #[serde(rename = "sessionId", skip_serializing_if = "Option::is_none")]
35    pub session_id: Option<String>,
36}
37
38impl EventView {
39    pub fn new() -> EventView {
40        EventView {
41            actor: None,
42            created_at: None,
43            id: None,
44            kind: None,
45            payload: None,
46            seq: None,
47            session_id: None,
48        }
49    }
50}
51