Skip to main content

orvanta_api/models/
evaluate_request.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: 1.7.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct EvaluateRequest {
16    /// A saved dmn_decision path to load and evaluate
17    #[serde(rename = "decision_id", skip_serializing_if = "Option::is_none")]
18    pub decision_id: Option<String>,
19    /// Input values keyed by FEEL variable name
20    #[serde(rename = "inputs")]
21    pub inputs: std::collections::HashMap<String, serde_json::Value>,
22    /// Inline DMN 1.3 XML to evaluate instead of a saved decision_id
23    #[serde(rename = "xml", skip_serializing_if = "Option::is_none")]
24    pub xml: Option<String>,
25    /// In-document `<decision id>` selector, separate from decision_id (which is the storage path when loading a saved decision). When set, selects which decision inside the document to evaluate -- e.g. a decision other than the first in a saved multi-decision document. When omitted, inline xml falls back to decision_id as its selector and a stored decision evaluates its first decision element. Optional and backwards-compatible. 
26    #[serde(rename = "decision_ref", skip_serializing_if = "Option::is_none")]
27    pub decision_ref: Option<String>,
28}
29
30impl EvaluateRequest {
31    pub fn new(inputs: std::collections::HashMap<String, serde_json::Value>) -> EvaluateRequest {
32        EvaluateRequest {
33            decision_id: None,
34            inputs,
35            xml: None,
36            decision_ref: None,
37        }
38    }
39}
40