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

/// CmmnCaseInstance : The pure engine's own state, embedded verbatim in `CmmnCaseStatus`. Owned by `orvanta-cmmn`, which depends on no I/O --- a change to this shape is a change in that crate.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CmmnCaseInstance {
    /// The `<case id>` the deployed document declares.
    #[serde(rename = "case_id")]
    pub case_id: String,
    #[serde(rename = "state")]
    pub state: models::CmmnCaseState,
    #[serde(rename = "instances")]
    pub instances: Vec<models::CmmnPlanItemInstance>,
    /// Case variables. Arbitrary JSON by definition.
    #[serde(rename = "variables")]
    pub variables: std::collections::HashMap<String, serde_json::Value>,
    #[serde(rename = "history")]
    pub history: Vec<models::CmmnTraceEvent>,
    /// Case-level `completable`, feeding `${cmmn:isStageCompletable()}` at the case plan model.
    #[serde(rename = "completable")]
    pub completable: bool,
    /// Criterion latches for the case plan model's own exit criteria, keyed by criterion id.
    #[serde(rename = "satisfied_on_parts")]
    pub satisfied_on_parts: std::collections::HashMap<String, Vec<String>>,
    #[serde(rename = "satisfied_if_parts")]
    pub satisfied_if_parts: Vec<String>,
}

impl CmmnCaseInstance {
    /// The pure engine's own state, embedded verbatim in `CmmnCaseStatus`. Owned by `orvanta-cmmn`, which depends on no I/O --- a change to this shape is a change in that crate.
    pub fn new(case_id: String, state: models::CmmnCaseState, instances: Vec<models::CmmnPlanItemInstance>, variables: std::collections::HashMap<String, serde_json::Value>, history: Vec<models::CmmnTraceEvent>, completable: bool, satisfied_on_parts: std::collections::HashMap<String, Vec<String>>, satisfied_if_parts: Vec<String>) -> CmmnCaseInstance {
        CmmnCaseInstance {
            case_id,
            state,
            instances,
            variables,
            history,
            completable,
            satisfied_on_parts,
            satisfied_if_parts,
        }
    }
}