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

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

/// 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.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BpmnMappingRefusal {
    #[serde(rename = "error")]
    pub error: String,
    #[serde(rename = "from_version", skip_serializing_if = "Option::is_none")]
    pub from_version: Option<i64>,
    #[serde(rename = "to_version", skip_serializing_if = "Option::is_none")]
    pub to_version: Option<i64>,
    #[serde(rename = "blockers", skip_serializing_if = "Option::is_none")]
    pub blockers: Option<Vec<models::BpmnMappingBlocker>>,
}

impl 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.
    pub fn new(error: String) -> BpmnMappingRefusal {
        BpmnMappingRefusal {
            error,
            from_version: None,
            to_version: None,
            blockers: None,
        }
    }
}