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

/// CmmnCaseInstanceStatus : Everything the Case View re-reads on its 1s poll, and nothing else (#1499).  **The trace is absent by construction, not empty.** There is no `history` property here rather than an emptied one, because a `[]` a reader could mistake for \"this case has done nothing\" is the silent shape this codebase keeps unwinding. `history_len` is how many events the full document carries. 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CmmnCaseInstanceStatus {
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    #[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>>,
    #[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 = "job_status", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub job_status: Option<Option<String>>,
    /// Best-effort \"last touched\", through the same fallback chain `getBpmnInstanceStatus` uses and for the same reason: `cmmn_case_status` has no per-write `updated_at` column, only a `created_at` set once on insert.
    #[serde(rename = "updated_at")]
    pub updated_at: String,
    /// `null` in the window between the job being pushed and its first step committing.
    #[serde(rename = "case_state", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub case_state: Option<Option<models::CmmnCaseState>>,
    #[serde(rename = "lifecycle", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub lifecycle: Option<Option<Box<models::CmmnCaseLifecycle>>>,
    /// case-level `completable`, feeding `${cmmn:isStageCompletable()}`
    #[serde(rename = "completable")]
    pub completable: bool,
    #[serde(rename = "instances")]
    pub instances: Vec<models::CmmnPlanItemInstance>,
    #[serde(rename = "variables")]
    pub variables: std::collections::HashMap<String, serde_json::Value>,
    #[serde(rename = "waiting")]
    pub waiting: Vec<models::CmmnWaitingItem>,
    #[serde(rename = "incidents")]
    pub incidents: Vec<models::CmmnIncident>,
    /// `case.history.length` in the full document. Reported so a client can tell \"no trace here\" from \"no trace yet\" without fetching it.
    #[serde(rename = "history_len")]
    pub history_len: i32,
}

impl CmmnCaseInstanceStatus {
    /// Everything the Case View re-reads on its 1s poll, and nothing else (#1499).  **The trace is absent by construction, not empty.** There is no `history` property here rather than an emptied one, because a `[]` a reader could mistake for \"this case has done nothing\" is the silent shape this codebase keeps unwinding. `history_len` is how many events the full document carries. 
    pub fn new(id: uuid::Uuid, created_at: String, updated_at: String, completable: bool, instances: Vec<models::CmmnPlanItemInstance>, variables: std::collections::HashMap<String, serde_json::Value>, waiting: Vec<models::CmmnWaitingItem>, incidents: Vec<models::CmmnIncident>, history_len: i32) -> CmmnCaseInstanceStatus {
        CmmnCaseInstanceStatus {
            id,
            cmmn_case_path: None,
            cmmn_version: None,
            business_key: None,
            created_at,
            job_status: None,
            updated_at,
            case_state: None,
            lifecycle: None,
            completable,
            instances,
            variables,
            waiting,
            incidents,
            history_len,
        }
    }
}