orvanta-api 1.6.0

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.6.0
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// BpmnInstanceSummary : one row of the instance list -- cheap columns only, no tokens/activities/variables (see BpmnInstanceDetail)
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BpmnInstanceSummary {
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "workspace_id")]
    pub workspace_id: String,
    #[serde(rename = "bpmn_flow_path", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub bpmn_flow_path: Option<Option<String>>,
    #[serde(rename = "bpmn_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub bpmn_version: Option<Option<i64>>,
    #[serde(rename = "created_at")]
    pub created_at: String,
    #[serde(rename = "created_by")]
    pub created_by: String,
    #[serde(rename = "started_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub started_at: Option<Option<String>>,
    #[serde(rename = "completed_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub completed_at: Option<Option<String>>,
    #[serde(rename = "job_status", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub job_status: Option<Option<String>>,
    #[serde(rename = "canceled_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub canceled_by: Option<Option<String>>,
    /// process_status.lifecycle's tagged type: running / completed / incident. NULL if the engine has not picked the instance up yet.
    #[serde(rename = "lifecycle", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub lifecycle: Option<Option<Lifecycle>>,
}

impl BpmnInstanceSummary {
    /// one row of the instance list -- cheap columns only, no tokens/activities/variables (see BpmnInstanceDetail)
    pub fn new(id: uuid::Uuid, workspace_id: String, created_at: String, created_by: String) -> BpmnInstanceSummary {
        BpmnInstanceSummary {
            id,
            workspace_id,
            bpmn_flow_path: None,
            bpmn_version: None,
            created_at,
            created_by,
            started_at: None,
            completed_at: None,
            job_status: None,
            canceled_by: None,
            lifecycle: None,
        }
    }
}
/// process_status.lifecycle's tagged type: running / completed / incident. NULL if the engine has not picked the instance up yet.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Lifecycle {
    #[serde(rename = "running")]
    Running,
    #[serde(rename = "completed")]
    Completed,
    #[serde(rename = "incident")]
    Incident,
}

impl Default for Lifecycle {
    fn default() -> Lifecycle {
        Self::Running
    }
}