1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* 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};
/// BpmnValidationIssue : One problem found by deploy-time BPMN validation (`backend/orvanta-bpmn/src/validate.rs`). Warnings and errors share this shape and are told apart by `severity`.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BpmnValidationIssue {
/// The rule that fired, e.g. `MissingScriptBinding`, `IncompleteConditionCoverage`. Stable — branch on this, not on `message`.
#[serde(rename = "code")]
pub code: String,
/// `error` blocks the deploy (the request is a 400). `warning` does not: the deploy succeeded and the warning is advisory.
#[serde(rename = "severity")]
pub severity: Severity,
/// A sentence for a human, naming the offending id(s).
#[serde(rename = "message")]
pub message: String,
/// The elements this problem is *about* — what an editor should mark on the canvas. Empty when the problem names nothing on the canvas (an unnamed unrecognized element, a whole-scope rule on the root process). Never the id of a *referenced* element that is missing: marking that would flag an innocent shape.
#[serde(rename = "element_ids")]
pub element_ids: Vec<String>,
}
impl BpmnValidationIssue {
/// One problem found by deploy-time BPMN validation (`backend/orvanta-bpmn/src/validate.rs`). Warnings and errors share this shape and are told apart by `severity`.
pub fn new(code: String, severity: Severity, message: String, element_ids: Vec<String>) -> BpmnValidationIssue {
BpmnValidationIssue {
code,
severity,
message,
element_ids,
}
}
}
/// `error` blocks the deploy (the request is a 400). `warning` does not: the deploy succeeded and the warning is advisory.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Severity {
#[serde(rename = "error")]
Error,
#[serde(rename = "warning")]
Warning,
}
impl Default for Severity {
fn default() -> Severity {
Self::Error
}
}