Skip to main content

orvanta_api/models/
bpmn_validation_report.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: 6.2.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// BpmnValidationReport : What `POST /bpmn_flows/validate` answers. Returned with **200 in every case the document is at fault** -- a 400 carrying the same list would make \"your XML is wrong\" indistinguishable from \"your request is wrong\", which is the distinction a caller needs in order to decide whether retrying can help.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct BpmnValidationReport {
17    /// `true` when this document would deploy: it compiled and no issue has `severity: error`. Warnings do not clear it -- they never block. This is the field to branch on.
18    #[serde(rename = "ok")]
19    pub ok: bool,
20    /// `false` when the document never reached a compiled model, so every check that needs one was skipped. `compiled: false` with an empty `issues` list is impossible.
21    #[serde(rename = "compiled")]
22    pub compiled: bool,
23    /// Every finding, errors and warnings together, in the same shape a deploy returns.
24    #[serde(rename = "issues")]
25    pub issues: Vec<models::BpmnValidationIssue>,
26}
27
28impl BpmnValidationReport {
29    /// What `POST /bpmn_flows/validate` answers. Returned with **200 in every case the document is at fault** -- a 400 carrying the same list would make \"your XML is wrong\" indistinguishable from \"your request is wrong\", which is the distinction a caller needs in order to decide whether retrying can help.
30    pub fn new(ok: bool, compiled: bool, issues: Vec<models::BpmnValidationIssue>) -> BpmnValidationReport {
31        BpmnValidationReport {
32            ok,
33            compiled,
34            issues,
35        }
36    }
37}
38