Skip to main content

orvanta_api/models/
bpmn_instance_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: 1.6.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// BpmnInstanceSummary : one row of the instance list -- cheap columns only, no tokens/activities/variables (see BpmnInstanceDetail)
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct BpmnInstanceSummary {
17    #[serde(rename = "id")]
18    pub id: uuid::Uuid,
19    #[serde(rename = "workspace_id")]
20    pub workspace_id: String,
21    #[serde(rename = "bpmn_flow_path", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub bpmn_flow_path: Option<Option<String>>,
23    #[serde(rename = "bpmn_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub bpmn_version: Option<Option<i64>>,
25    #[serde(rename = "created_at")]
26    pub created_at: String,
27    #[serde(rename = "created_by")]
28    pub created_by: String,
29    #[serde(rename = "started_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub started_at: Option<Option<String>>,
31    #[serde(rename = "completed_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub completed_at: Option<Option<String>>,
33    #[serde(rename = "job_status", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub job_status: Option<Option<String>>,
35    #[serde(rename = "canceled_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub canceled_by: Option<Option<String>>,
37    /// process_status.lifecycle's tagged type: running / completed / incident. NULL if the engine has not picked the instance up yet.
38    #[serde(rename = "lifecycle", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
39    pub lifecycle: Option<Option<Lifecycle>>,
40}
41
42impl BpmnInstanceSummary {
43    /// one row of the instance list -- cheap columns only, no tokens/activities/variables (see BpmnInstanceDetail)
44    pub fn new(id: uuid::Uuid, workspace_id: String, created_at: String, created_by: String) -> BpmnInstanceSummary {
45        BpmnInstanceSummary {
46            id,
47            workspace_id,
48            bpmn_flow_path: None,
49            bpmn_version: None,
50            created_at,
51            created_by,
52            started_at: None,
53            completed_at: None,
54            job_status: None,
55            canceled_by: None,
56            lifecycle: None,
57        }
58    }
59}
60/// process_status.lifecycle's tagged type: running / completed / incident. NULL if the engine has not picked the instance up yet.
61#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
62pub enum Lifecycle {
63    #[serde(rename = "running")]
64    Running,
65    #[serde(rename = "completed")]
66    Completed,
67    #[serde(rename = "incident")]
68    Incident,
69}
70
71impl Default for Lifecycle {
72    fn default() -> Lifecycle {
73        Self::Running
74    }
75}
76