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

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

/// 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.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BpmnValidationReport {
    /// `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.
    #[serde(rename = "ok")]
    pub ok: bool,
    /// `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.
    #[serde(rename = "compiled")]
    pub compiled: bool,
    /// Every finding, errors and warnings together, in the same shape a deploy returns.
    #[serde(rename = "issues")]
    pub issues: Vec<models::BpmnValidationIssue>,
}

impl 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.
    pub fn new(ok: bool, compiled: bool, issues: Vec<models::BpmnValidationIssue>) -> BpmnValidationReport {
        BpmnValidationReport {
            ok,
            compiled,
            issues,
        }
    }
}