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};

/// CmmnCaseStatus : The persisted runtime state of a case instance (`cmmn_case_status.case_status`).  Written by exactly one worker at a time (invariant R6). Anything else that wants to influence a running case signals intent through `control`, a disjoint sub-object the worker reads and clears --- never by writing this blob wholesale. 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CmmnCaseStatus {
    /// On-disk schema version; bumped only on a non-backward-compatible change.
    #[serde(rename = "version")]
    pub version: i32,
    #[serde(rename = "case")]
    pub case: Box<models::CmmnCaseInstance>,
    #[serde(rename = "lifecycle")]
    pub lifecycle: Box<models::CmmnCaseLifecycle>,
    #[serde(rename = "incidents", skip_serializing_if = "Option::is_none")]
    pub incidents: Option<Vec<models::CmmnIncident>>,
    /// The instances currently parked for a human or an external system, as the last step reported them. A projection of `case`, persisted so a case view can render the actionable set without re-running the engine.
    #[serde(rename = "waiting", skip_serializing_if = "Option::is_none")]
    pub waiting: Option<Vec<models::CmmnWaitingItem>>,
    #[serde(rename = "control", skip_serializing_if = "Option::is_none")]
    pub control: Option<Box<models::CmmnControl>>,
}

impl CmmnCaseStatus {
    /// The persisted runtime state of a case instance (`cmmn_case_status.case_status`).  Written by exactly one worker at a time (invariant R6). Anything else that wants to influence a running case signals intent through `control`, a disjoint sub-object the worker reads and clears --- never by writing this blob wholesale. 
    pub fn new(version: i32, case: models::CmmnCaseInstance, lifecycle: models::CmmnCaseLifecycle) -> CmmnCaseStatus {
        CmmnCaseStatus {
            version,
            case: Box::new(case),
            lifecycle: Box::new(lifecycle),
            incidents: None,
            waiting: None,
            control: None,
        }
    }
}