Skip to main content

orvanta_api/models/
bpmn_flow_version_rollup.rs

1/*
2 * Orvanta API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 3.0.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// BpmnFlowVersionRollup : one flow's live instances split across the versions they are pinned to
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct BpmnFlowVersionRollup {
17    /// the flow as it is named now, resolved through `bpmn_flow_version.path` so a rename does not produce a dead link
18    #[serde(rename = "bpmn_flow_path")]
19    pub bpmn_flow_path: String,
20    /// what a new start would pin to. Null when the flow row is not visible to the caller or has no deployed version.
21    #[serde(rename = "latest_version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub latest_version: Option<Option<i64>>,
23    #[serde(rename = "running_instances")]
24    pub running_instances: i64,
25    /// live instances not on `latest_version`
26    #[serde(rename = "outdated_instances")]
27    pub outdated_instances: i64,
28    /// newest pinned version first
29    #[serde(rename = "versions")]
30    pub versions: Vec<models::BpmnPinnedVersionRollup>,
31}
32
33impl BpmnFlowVersionRollup {
34    /// one flow's live instances split across the versions they are pinned to
35    pub fn new(bpmn_flow_path: String, running_instances: i64, outdated_instances: i64, versions: Vec<models::BpmnPinnedVersionRollup>) -> BpmnFlowVersionRollup {
36        BpmnFlowVersionRollup {
37            bpmn_flow_path,
38            latest_version: None,
39            running_instances,
40            outdated_instances,
41            versions,
42        }
43    }
44}
45