/*
* 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 PatchSessionIn {
/// 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.
#[serde(rename = "cwd", skip_serializing_if = "Option::is_none")]
pub cwd: Option<String>,
/// ID is the session to update, from the path.
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
/// 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.
#[serde(rename = "project", skip_serializing_if = "Option::is_none")]
pub project: Option<String>,
/// 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.
#[serde(rename = "published", skip_serializing_if = "Option::is_none")]
pub published: Option<bool>,
/// 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.
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
/// Target re-dispatches a session to a run-target (the #48 association). \"\" detaches.
#[serde(rename = "target", skip_serializing_if = "Option::is_none")]
pub target: Option<String>,
/// 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.
#[serde(rename = "terminal", skip_serializing_if = "Option::is_none")]
pub terminal: Option<String>,
/// 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.
#[serde(rename = "title", skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
}
impl PatchSessionIn {
pub fn new() -> PatchSessionIn {
PatchSessionIn {
cwd: None,
id: None,
project: None,
published: None,
status: None,
target: None,
terminal: None,
title: None,
}
}
}