hanzo_client/models/patch_session_in.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 PatchSessionIn {
16 /// Cwd is where the session is working NOW. It was write-once — captured at register and never again — which is right for a run that starts in a directory and stays there, and wrong for a linked shell, which is a place a person moves around in. The console showed the directory `hanzo link` happened to be run from and kept showing it after the shell had walked away, so the field answered \"which work is this\" with an answer that was true once. A pointer, so an unchanged path is an omitted field rather than a repeated write.
17 #[serde(rename = "cwd", skip_serializing_if = "Option::is_none")]
18 pub cwd: Option<String>,
19 /// ID is the session to update, from the path.
20 #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
21 pub id: Option<String>,
22 /// Project tags the product this session built; Published is the author's decision to let anyone read the story (provenance.go). Both are pointers so \"absent\" and \"cleared\" are different requests.
23 #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
24 pub project: Option<String>,
25 /// Published opens the session's story to the public build route; false withdraws it, and withdrawing is always allowed. PUBLISHING is refused unless the session names a Project — the one set in this same request, or the one already stored — because that route is keyed on (org, project). It widens READ access to what is already there and grants nothing else.
26 #[serde(rename = "published", skip_serializing_if = "Option::is_none")]
27 pub published: Option<bool>,
28 /// Status moves the session to running, paused, done or error. A session that has already finished refuses any change with 409 — done and error are monotonic — and moving INTO one stamps the end time. This is the surface REPORTING what happened; a control command never writes it.
29 #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
30 pub status: Option<String>,
31 /// Target re-dispatches a session to a run-target (the #48 association). \"\" detaches.
32 #[serde(rename = "target", skip_serializing_if = "Option::is_none")]
33 pub target: Option<String>,
34 /// Terminal publishes (or, with \"\", withdraws) the URL this session's live terminal can be watched at. A pointer so \"absent\" and \"withdrawn\" are different requests: a session that stops sharing must be able to say so.
35 #[serde(rename = "terminal", skip_serializing_if = "Option::is_none")]
36 pub terminal: Option<String>,
37 /// Title rewrites the human line, up to 512 characters — usually because the work turned out to be something other than what it was opened as.
38 #[serde(rename = "title", skip_serializing_if = "Option::is_none")]
39 pub title: Option<String>,
40}
41
42impl PatchSessionIn {
43 pub fn new() -> PatchSessionIn {
44 PatchSessionIn {
45 cwd: None,
46 id: None,
47 project: None,
48 published: None,
49 status: None,
50 target: None,
51 terminal: None,
52 title: None,
53 }
54 }
55}
56