Skip to main content

hanzo_client/models/
state_graph.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 StateGraph {
16    /// Initial is the state a fresh document starts in — \"draft\". A stored document with no status at all is read as this too.
17    #[serde(rename = "initial", skip_serializing_if = "Option::is_none")]
18    pub initial: Option<String>,
19    /// Live is the ONE state that is publicly readable — \"published\". The site pulls only documents in it, so reaching Live IS site-publish; every other state is invisible to a reader.
20    #[serde(rename = "live", skip_serializing_if = "Option::is_none")]
21    pub live: Option<String>,
22    /// States is every lifecycle state in canonical order: draft, in_review, approved, queued, published, archived. The console lays its board columns out in exactly this order, so the order is part of the answer.
23    #[serde(rename = "states", skip_serializing_if = "Option::is_none")]
24    pub states: Option<Vec<String>>,
25    /// Transitions maps each state to the states it may move to. A target absent from a state's list is REFUSED, at the endpoint and again at the storage boundary — this is the whole rule, not a hint for the UI. A state never lists itself; a move that changes nothing is always legal.
26    #[serde(rename = "transitions", skip_serializing_if = "Option::is_none")]
27    pub transitions: Option<std::collections::HashMap<String, Vec<String>>>,
28}
29
30impl StateGraph {
31    pub fn new() -> StateGraph {
32        StateGraph {
33            initial: None,
34            live: None,
35            states: None,
36            transitions: None,
37        }
38    }
39}
40