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

/// CmmnPlanItemInstance : One live plan-item instance inside a case.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CmmnPlanItemInstance {
    /// Index into `CmmnCaseInstance.instances`; stable for the case's lifetime.
    #[serde(rename = "idx")]
    pub idx: i32,
    #[serde(rename = "plan_item_id")]
    pub plan_item_id: String,
    #[serde(rename = "definition_id")]
    pub definition_id: String,
    #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub name: Option<Option<String>>,
    #[serde(rename = "def_kind")]
    pub def_kind: models::CmmnDefinitionKind,
    /// Which transition table governs this instance. `Milestone` is deliberately **not** an event listener.
    #[serde(rename = "kind")]
    pub kind: Kind,
    #[serde(rename = "state")]
    pub state: models::CmmnPlanItemState,
    /// Enclosing stage instance; `null` for the case plan model's own children, whose container is the case.
    #[serde(rename = "parent", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub parent: Option<Option<i32>>,
    #[serde(rename = "repetition_counter")]
    pub repetition_counter: i32,
    /// Local variables. Holds `repetitionCounter` under the name the model asked for (`flowable:counterVariable`, else the Flowable default).
    #[serde(rename = "local_variables")]
    pub local_variables: std::collections::HashMap<String, serde_json::Value>,
    /// Sentry on-part ids satisfied so far, keyed by **criterion** id, not sentry id: one sentry may be attached by several criteria and each attachment latches independently.
    #[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>,
    #[serde(rename = "completable")]
    pub completable: bool,
    /// The state held immediately before this instance was suspended, so `resume`/`parentResume` restores it exactly (#1292). Absent on a case suspended before the field existed, in which case `resume` falls back to `available`.
    #[serde(rename = "state_before_suspend", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub state_before_suspend: Option<Option<models::CmmnPlanItemState>>,
}

impl CmmnPlanItemInstance {
    /// One live plan-item instance inside a case.
    pub fn new(idx: i32, plan_item_id: String, definition_id: String, def_kind: models::CmmnDefinitionKind, kind: Kind, state: models::CmmnPlanItemState, repetition_counter: i32, local_variables: std::collections::HashMap<String, serde_json::Value>, satisfied_on_parts: std::collections::HashMap<String, Vec<String>>, satisfied_if_parts: Vec<String>, completable: bool) -> CmmnPlanItemInstance {
        CmmnPlanItemInstance {
            idx,
            plan_item_id,
            definition_id,
            name: None,
            def_kind,
            kind,
            state,
            parent: None,
            repetition_counter,
            local_variables,
            satisfied_on_parts,
            satisfied_if_parts,
            completable,
            state_before_suspend: None,
        }
    }
}
/// Which transition table governs this instance. `Milestone` is deliberately **not** an event listener.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Kind {
    #[serde(rename = "PlanItem")]
    PlanItem,
    #[serde(rename = "EventListener")]
    EventListener,
}

impl Default for Kind {
    fn default() -> Kind {
        Self::PlanItem
    }
}