hanzo_client/models/register_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 RegisterReq {
16 /// Account is which subscription or API account under that provider served the run, up to 256 characters. It is what lets a revoke of that login stop exactly the sessions it was paying for.
17 #[serde(rename = "account", skip_serializing_if = "Option::is_none")]
18 pub account: Option<String>,
19 /// Actor is the \"org/sub\" identity to record the session under, up to 256 characters. Omit it and the calling principal is used, which is almost always what you want: it is what a login revoke matches on to stop this session.
20 #[serde(rename = "actor", skip_serializing_if = "Option::is_none")]
21 pub actor: Option<String>,
22 /// Agent is the label the surface opening this session calls itself by (\"hanzo-dev\"). REQUIRED, up to 128 characters, and free text — nothing resolves it against a defined agent.
23 #[serde(rename = "agent", skip_serializing_if = "Option::is_none")]
24 pub agent: Option<String>,
25 /// Cwd is the directory the session starts in, up to 1024 characters. It can be moved later, because a linked shell walks around.
26 #[serde(rename = "cwd", skip_serializing_if = "Option::is_none")]
27 pub cwd: Option<String>,
28 /// Execution context — where this session runs (all optional).
29 #[serde(rename = "host", skip_serializing_if = "Option::is_none")]
30 pub host: Option<String>,
31 /// ParentSessionID makes this a subagent of that session: it inherits the parent's root, so one flow stays one tree. The parent must exist IN THE SAME ORG — a foreign or unknown id is a 400, never a tree across tenants. Empty opens a root session.
32 #[serde(rename = "parentSessionId", skip_serializing_if = "Option::is_none")]
33 pub parent_session_id: Option<String>,
34 /// The readable build (provenance.go): which product this session builds, and whether its story may be read by the world.
35 #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
36 pub project: Option<String>,
37 /// Account tag — the linked AI account this session ran under (login manager).
38 #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
39 pub provider: Option<String>,
40 /// Published opens this session's story to the public build route. It is refused without a Project, because that route is keyed on (org, project) — a build with no product is not a story anyone can open. False keeps it org-only.
41 #[serde(rename = "published", skip_serializing_if = "Option::is_none")]
42 pub published: Option<bool>,
43 /// Repo is the code being worked on, up to 512 characters. A label the surface states; nothing resolves it against the forge.
44 #[serde(rename = "repo", skip_serializing_if = "Option::is_none")]
45 pub repo: Option<String>,
46 /// Room is the collaborative room this run was started in (HIP-0523), so a workspace view can list the sessions of one room. It is PROVENANCE and is set only here: there is deliberately no way to move a session to another room, so it is absent from the patch input and from UpdateSession's SET list.
47 #[serde(rename = "room", skip_serializing_if = "Option::is_none")]
48 pub room: Option<String>,
49 /// Status opens the session in one of running, paused, done or error. Empty means running. A TERMINAL status here (done, error) records a session that has already finished — its end time is stamped now — and nothing can move it afterwards.
50 #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
51 pub status: Option<String>,
52 /// Target names a run-target the org has registered. Unlike Host and Repo it IS resolved: a target that does not exist in this org is a 400, so a session can never claim to run on another tenant's machine. Empty names no machine.
53 #[serde(rename = "target", skip_serializing_if = "Option::is_none")]
54 pub target: Option<String>,
55 /// TaskRunID is that workflow's particular run, same bound. Recorded, not resolved: this surface does not check the workflow exists.
56 #[serde(rename = "taskRunId", skip_serializing_if = "Option::is_none")]
57 pub task_run_id: Option<String>,
58 /// TaskWorkflowID links this session to the hanzoai/tasks workflow that executes it, up to 256 characters. Set it and control commands are forwarded to that engine; leave it and the running surface polls for them instead.
59 #[serde(rename = "taskWorkflowId", skip_serializing_if = "Option::is_none")]
60 pub task_workflow_id: Option<String>,
61 /// Terminal is the URL this session's live terminal is published at, so the console can watch it. Optional — a session that publishes nothing is still a session.
62 #[serde(rename = "terminal", skip_serializing_if = "Option::is_none")]
63 pub terminal: Option<String>,
64 /// Title is the human line a card shows, up to 512 characters. Optional, and changeable later.
65 #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
66 pub title: Option<String>,
67}
68
69impl RegisterReq {
70 pub fn new() -> RegisterReq {
71 RegisterReq {
72 account: None,
73 actor: None,
74 agent: None,
75 cwd: None,
76 host: None,
77 parent_session_id: None,
78 project: None,
79 provider: None,
80 published: None,
81 repo: None,
82 room: None,
83 status: None,
84 target: None,
85 task_run_id: None,
86 task_workflow_id: None,
87 terminal: None,
88 title: None,
89 }
90 }
91}
92