Skip to main content

orvanta_api/models/
cmmn_case_summary.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.3.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// CmmnCaseSummary : One row of the case-instance list (#1499) --- cheap columns only.  The BPMN sibling is `BpmnInstanceSummary`, and the field CMMN needed its own row for is `business_key`: it lives on `cmmn_case_status` and no job-shaped response carries it, so without this the list had to read each case's full detail --- engine blob, trace and all --- to fill one column. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CmmnCaseSummary {
17    #[serde(rename = "id")]
18    pub id: uuid::Uuid,
19    #[serde(rename = "workspace_id")]
20    pub workspace_id: String,
21    /// The *current* path of the pinned model, resolved through `cmmn_case_model_version`. Reading the value denormalised at start time alone would name the path the case was started at, which a later rename has moved on from.
22    #[serde(rename = "cmmn_case_path", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub cmmn_case_path: Option<Option<String>>,
24    /// the `cmmn_case_model_version.id` this case resolves its model from
25    #[serde(rename = "cmmn_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub cmmn_version: Option<Option<i64>>,
27    #[serde(rename = "business_key", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub business_key: Option<Option<String>>,
29    #[serde(rename = "created_at")]
30    pub created_at: String,
31    #[serde(rename = "created_by")]
32    pub created_by: String,
33    #[serde(rename = "started_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub started_at: Option<Option<String>>,
35    #[serde(rename = "completed_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub completed_at: Option<Option<String>>,
37    #[serde(rename = "job_status", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
38    pub job_status: Option<Option<String>>,
39    #[serde(rename = "canceled_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
40    pub canceled_by: Option<Option<String>>,
41    /// `case_status.lifecycle`'s tagged `type`, or `null` when the engine has not picked the job up yet.
42    #[serde(rename = "lifecycle", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
43    pub lifecycle: Option<Option<Lifecycle>>,
44    /// The case's own CMMN state, which can legitimately disagree with `lifecycle` --- an `active` case may carry an `incident`. Both are reported because the badge is derived from both.
45    #[serde(rename = "case_state", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
46    pub case_state: Option<Option<models::CmmnCaseState>>,
47}
48
49impl CmmnCaseSummary {
50    /// One row of the case-instance list (#1499) --- cheap columns only.  The BPMN sibling is `BpmnInstanceSummary`, and the field CMMN needed its own row for is `business_key`: it lives on `cmmn_case_status` and no job-shaped response carries it, so without this the list had to read each case's full detail --- engine blob, trace and all --- to fill one column. 
51    pub fn new(id: uuid::Uuid, workspace_id: String, created_at: String, created_by: String) -> CmmnCaseSummary {
52        CmmnCaseSummary {
53            id,
54            workspace_id,
55            cmmn_case_path: None,
56            cmmn_version: None,
57            business_key: None,
58            created_at,
59            created_by,
60            started_at: None,
61            completed_at: None,
62            job_status: None,
63            canceled_by: None,
64            lifecycle: None,
65            case_state: None,
66        }
67    }
68}
69/// `case_status.lifecycle`'s tagged `type`, or `null` when the engine has not picked the job up yet.
70#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
71pub enum Lifecycle {
72    #[serde(rename = "running")]
73    Running,
74    #[serde(rename = "completed")]
75    Completed,
76    #[serde(rename = "incident")]
77    Incident,
78}
79
80impl Default for Lifecycle {
81    fn default() -> Lifecycle {
82        Self::Running
83    }
84}
85