/*
* 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};
/// BpmnMigrationBlocker : One reason a (from_version, to_version) pair is not eligible for an identity migration (#922). `rule` is the discriminant; `rule_number` groups it (1 superset -- every v1 element id, sequence-flow id and message name exists in v2; 2 stable meaning -- an id that survives must still denote the same kind, scope, process and message binding; 3 join stability -- no element's set of incoming sequence flows may change, because `JoinState.expected` is derived once and never refreshed, so a stale one wedges the instance with no error at all). The remaining properties are the rule's own, and which are present depends on `rule`.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BpmnMigrationBlocker {
#[serde(rename = "rule")]
pub rule: Rule,
#[serde(rename = "rule_number")]
pub rule_number: i32,
/// the rendered sentence, safe to show an operator as-is
#[serde(rename = "message")]
pub message: String,
#[serde(rename = "element_id", skip_serializing_if = "Option::is_none")]
pub element_id: Option<String>,
#[serde(rename = "flow_id", skip_serializing_if = "Option::is_none")]
pub flow_id: Option<String>,
#[serde(rename = "message_name", skip_serializing_if = "Option::is_none")]
pub message_name: Option<String>,
#[serde(rename = "kind", skip_serializing_if = "Option::is_none")]
pub kind: Option<String>,
#[serde(rename = "from", skip_serializing_if = "Option::is_none")]
pub from: Option<String>,
#[serde(rename = "to", skip_serializing_if = "Option::is_none")]
pub to: Option<String>,
#[serde(rename = "removed", skip_serializing_if = "Option::is_none")]
pub removed: Option<Vec<String>>,
#[serde(rename = "added", skip_serializing_if = "Option::is_none")]
pub added: Option<Vec<String>>,
}
impl BpmnMigrationBlocker {
/// One reason a (from_version, to_version) pair is not eligible for an identity migration (#922). `rule` is the discriminant; `rule_number` groups it (1 superset -- every v1 element id, sequence-flow id and message name exists in v2; 2 stable meaning -- an id that survives must still denote the same kind, scope, process and message binding; 3 join stability -- no element's set of incoming sequence flows may change, because `JoinState.expected` is derived once and never refreshed, so a stale one wedges the instance with no error at all). The remaining properties are the rule's own, and which are present depends on `rule`.
pub fn new(rule: Rule, rule_number: i32, message: String) -> BpmnMigrationBlocker {
BpmnMigrationBlocker {
rule,
rule_number,
message,
element_id: None,
flow_id: None,
message_name: None,
kind: None,
from: None,
to: None,
removed: None,
added: None,
}
}
}
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Rule {
#[serde(rename = "process_id_changed")]
ProcessIdChanged,
#[serde(rename = "element_removed")]
ElementRemoved,
#[serde(rename = "element_kind_changed")]
ElementKindChanged,
#[serde(rename = "element_scope_changed")]
ElementScopeChanged,
#[serde(rename = "sequence_flow_removed")]
SequenceFlowRemoved,
#[serde(rename = "message_name_removed")]
MessageNameRemoved,
#[serde(rename = "message_binding_changed")]
MessageBindingChanged,
#[serde(rename = "incoming_flows_changed")]
IncomingFlowsChanged,
}
impl Default for Rule {
fn default() -> Rule {
Self::ProcessIdChanged
}
}