Skip to main content

orvanta_api/models/
cmmn_case_instance_status.rs

1/*
2 * Orvanta API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 6.5.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// CmmnCaseInstanceStatus : Everything the Case View re-reads on its 1s poll, and nothing else (#1499).  **The trace is absent by construction, not empty.** There is no `history` property here rather than an emptied one, because a `[]` a reader could mistake for \"this case has done nothing\" is the silent shape this codebase keeps unwinding. `history_len` is how many events the full document carries. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CmmnCaseInstanceStatus {
17    #[serde(rename = "id")]
18    pub id: uuid::Uuid,
19    #[serde(rename = "cmmn_case_path", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
20    pub cmmn_case_path: Option<Option<String>>,
21    #[serde(rename = "cmmn_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub cmmn_version: Option<Option<i64>>,
23    #[serde(rename = "business_key", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub business_key: Option<Option<String>>,
25    #[serde(rename = "created_at")]
26    pub created_at: String,
27    #[serde(rename = "job_status", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub job_status: Option<Option<String>>,
29    /// Best-effort \"last touched\", through the same fallback chain `getBpmnInstanceStatus` uses and for the same reason: `cmmn_case_status` has no per-write `updated_at` column, only a `created_at` set once on insert.
30    #[serde(rename = "updated_at")]
31    pub updated_at: String,
32    /// `null` in the window between the job being pushed and its first step committing.
33    #[serde(rename = "case_state", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub case_state: Option<Option<models::CmmnCaseState>>,
35    #[serde(rename = "lifecycle", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub lifecycle: Option<Option<Box<models::CmmnCaseLifecycle>>>,
37    /// case-level `completable`, feeding `${cmmn:isStageCompletable()}`
38    #[serde(rename = "completable")]
39    pub completable: bool,
40    #[serde(rename = "instances")]
41    pub instances: Vec<models::CmmnPlanItemInstance>,
42    #[serde(rename = "variables")]
43    pub variables: std::collections::HashMap<String, serde_json::Value>,
44    #[serde(rename = "waiting")]
45    pub waiting: Vec<models::CmmnWaitingItem>,
46    #[serde(rename = "incidents")]
47    pub incidents: Vec<models::CmmnIncident>,
48    /// `case.history.length` in the full document. Reported so a client can tell \"no trace here\" from \"no trace yet\" without fetching it.
49    #[serde(rename = "history_len")]
50    pub history_len: i32,
51}
52
53impl CmmnCaseInstanceStatus {
54    /// Everything the Case View re-reads on its 1s poll, and nothing else (#1499).  **The trace is absent by construction, not empty.** There is no `history` property here rather than an emptied one, because a `[]` a reader could mistake for \"this case has done nothing\" is the silent shape this codebase keeps unwinding. `history_len` is how many events the full document carries. 
55    pub fn new(id: uuid::Uuid, created_at: String, updated_at: String, completable: bool, instances: Vec<models::CmmnPlanItemInstance>, variables: std::collections::HashMap<String, serde_json::Value>, waiting: Vec<models::CmmnWaitingItem>, incidents: Vec<models::CmmnIncident>, history_len: i32) -> CmmnCaseInstanceStatus {
56        CmmnCaseInstanceStatus {
57            id,
58            cmmn_case_path: None,
59            cmmn_version: None,
60            business_key: None,
61            created_at,
62            job_status: None,
63            updated_at,
64            case_state: None,
65            lifecycle: None,
66            completable,
67            instances,
68            variables,
69            waiting,
70            incidents,
71            history_len,
72        }
73    }
74}
75