Skip to main content

orvanta_api/models/
bpmn_mapping_refusal.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: 3.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/// BpmnMappingRefusal : The 400 body when the *mapped* contract refuses a request (#925). Same envelope as BpmnMigrationRefusal on purpose, so one client-side renderer handles both: `error` is a readable sentence for a client that reads one field, `blockers` carries the rule number, the rendered sentence and the rule's own fields, which is what a UI needs to mark the offending shapes without knowing the discriminant names.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct BpmnMappingRefusal {
17    #[serde(rename = "error")]
18    pub error: String,
19    #[serde(rename = "from_version", skip_serializing_if = "Option::is_none")]
20    pub from_version: Option<i64>,
21    #[serde(rename = "to_version", skip_serializing_if = "Option::is_none")]
22    pub to_version: Option<i64>,
23    #[serde(rename = "blockers", skip_serializing_if = "Option::is_none")]
24    pub blockers: Option<Vec<models::BpmnMappingBlocker>>,
25}
26
27impl BpmnMappingRefusal {
28    /// The 400 body when the *mapped* contract refuses a request (#925). Same envelope as BpmnMigrationRefusal on purpose, so one client-side renderer handles both: `error` is a readable sentence for a client that reads one field, `blockers` carries the rule number, the rendered sentence and the rule's own fields, which is what a UI needs to mark the offending shapes without knowing the discriminant names.
29    pub fn new(error: String) -> BpmnMappingRefusal {
30        BpmnMappingRefusal {
31            error,
32            from_version: None,
33            to_version: None,
34            blockers: None,
35        }
36    }
37}
38