orvanta-api 3.0.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.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
    }
}