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

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

/// BpmnPinnedVersionRollup : One `bpmn_flow_version` with live instances pinned to it (#919), carrying the migratability verdict for (this version -> latest).
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BpmnPinnedVersionRollup {
    /// the `bpmn_flow_version.id` these instances resolve their model from
    #[serde(rename = "version")]
    pub version: i64,
    /// null once the version row is gone
    #[serde(rename = "created_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<Option<String>>,
    #[serde(rename = "created_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub created_by: Option<Option<String>>,
    /// live, uncancelled root instances pinned here
    #[serde(rename = "running_instances")]
    pub running_instances: i64,
    #[serde(rename = "is_latest")]
    pub is_latest: bool,
    /// how many newer deployed versions of this flow exist; 0 means latest. Null when this version is not in `bpmn_flow.versions` (typically because the flow row is not visible to the caller).
    #[serde(rename = "versions_behind", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub versions_behind: Option<Option<i64>>,
    /// #922's verdict. Null when it was not computed -- because this is already latest, because `check=false`, because the response's check limit was reached, or because a definition would not resolve. `check_error` distinguishes those; a null is never a \"no\".
    #[serde(rename = "migratable_to_latest", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub migratable_to_latest: Option<Option<bool>>,
    /// every reason, named, when `migratable_to_latest` is false. Same shape the migrate endpoints refuse with, so one canvas rendering serves both. Omitted when empty.
    #[serde(rename = "blockers", skip_serializing_if = "Option::is_none")]
    pub blockers: Option<Vec<models::BpmnMigrationBlocker>>,
    /// why there is no verdict. Omitted whenever there is one.
    #[serde(rename = "check_error", skip_serializing_if = "Option::is_none")]
    pub check_error: Option<String>,
}

impl BpmnPinnedVersionRollup {
    /// One `bpmn_flow_version` with live instances pinned to it (#919), carrying the migratability verdict for (this version -> latest).
    pub fn new(version: i64, running_instances: i64, is_latest: bool) -> BpmnPinnedVersionRollup {
        BpmnPinnedVersionRollup {
            version,
            created_at: None,
            created_by: None,
            running_instances,
            is_latest,
            versions_behind: None,
            migratable_to_latest: None,
            blockers: None,
            check_error: None,
        }
    }
}