orvanta-api 6.5.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: 6.5.0
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

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

/// 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. 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CmmnCaseSummary {
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[serde(rename = "workspace_id")]
    pub workspace_id: String,
    /// 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.
    #[serde(rename = "cmmn_case_path", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub cmmn_case_path: Option<Option<String>>,
    /// the `cmmn_case_model_version.id` this case resolves its model from
    #[serde(rename = "cmmn_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub cmmn_version: Option<Option<i64>>,
    #[serde(rename = "business_key", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub business_key: Option<Option<String>>,
    #[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>>,
    /// `case_status.lifecycle`'s tagged `type`, or `null` when the engine has not picked the job up yet.
    #[serde(rename = "lifecycle", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub lifecycle: Option<Option<Lifecycle>>,
    /// 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.
    #[serde(rename = "case_state", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub case_state: Option<Option<models::CmmnCaseState>>,
}

impl 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. 
    pub fn new(id: uuid::Uuid, workspace_id: String, created_at: String, created_by: String) -> CmmnCaseSummary {
        CmmnCaseSummary {
            id,
            workspace_id,
            cmmn_case_path: None,
            cmmn_version: None,
            business_key: None,
            created_at,
            created_by,
            started_at: None,
            completed_at: None,
            job_status: None,
            canceled_by: None,
            lifecycle: None,
            case_state: None,
        }
    }
}
/// `case_status.lifecycle`'s tagged `type`, or `null` when the engine has not picked the job 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
    }
}