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

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

/// BpmnFlowVersionRollup : one flow's live instances split across the versions they are pinned to
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BpmnFlowVersionRollup {
    /// the flow as it is named now, resolved through `bpmn_flow_version.path` so a rename does not produce a dead link
    #[serde(rename = "bpmn_flow_path")]
    pub bpmn_flow_path: String,
    /// what a new start would pin to. Null when the flow row is not visible to the caller or has no deployed version.
    #[serde(rename = "latest_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub latest_version: Option<Option<i64>>,
    #[serde(rename = "running_instances")]
    pub running_instances: i64,
    /// live instances not on `latest_version`
    #[serde(rename = "outdated_instances")]
    pub outdated_instances: i64,
    /// newest pinned version first
    #[serde(rename = "versions")]
    pub versions: Vec<models::BpmnPinnedVersionRollup>,
}

impl BpmnFlowVersionRollup {
    /// one flow's live instances split across the versions they are pinned to
    pub fn new(bpmn_flow_path: String, running_instances: i64, outdated_instances: i64, versions: Vec<models::BpmnPinnedVersionRollup>) -> BpmnFlowVersionRollup {
        BpmnFlowVersionRollup {
            bpmn_flow_path,
            latest_version: None,
            running_instances,
            outdated_instances,
            versions,
        }
    }
}