Skip to main content

orvanta_api/models/
evaluated_decision_summary.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.0.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 EvaluatedDecisionSummary {
16    #[serde(rename = "decision_id")]
17    pub decision_id: String,
18    #[serde(rename = "decision_name")]
19    pub decision_name: String,
20    /// The `<variable name>` this decision's result was bound under
21    #[serde(rename = "variable")]
22    pub variable: String,
23    /// True for an `<outputDecision>` of the service, false for an `<encapsulatedDecision>` whose result feeds other decisions but is not returned. 
24    #[serde(rename = "is_output")]
25    pub is_output: bool,
26    #[serde(rename = "hit_policy")]
27    pub hit_policy: String,
28    #[serde(rename = "aggregation", skip_serializing_if = "Option::is_none")]
29    pub aggregation: Option<Aggregation>,
30    #[serde(rename = "matched_rules")]
31    pub matched_rules: Vec<i32>,
32    /// The decision's result as a value: the scalar for a single-output table, a {column: value} object for a multi-output one, null when no rule matched (DMN 1.3 section 8.2.11 / Table 44). 
33    #[serde(rename = "value", deserialize_with = "Option::deserialize")]
34    pub value: Option<serde_json::Value>,
35}
36
37impl EvaluatedDecisionSummary {
38    pub fn new(decision_id: String, decision_name: String, variable: String, is_output: bool, hit_policy: String, matched_rules: Vec<i32>, value: Option<serde_json::Value>) -> EvaluatedDecisionSummary {
39        EvaluatedDecisionSummary {
40            decision_id,
41            decision_name,
42            variable,
43            is_output,
44            hit_policy,
45            aggregation: None,
46            matched_rules,
47            value,
48        }
49    }
50}
51/// 
52#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
53pub enum Aggregation {
54    #[serde(rename = "SUM")]
55    Sum,
56    #[serde(rename = "MIN")]
57    Min,
58    #[serde(rename = "MAX")]
59    Max,
60    #[serde(rename = "COUNT")]
61    Count,
62}
63
64impl Default for Aggregation {
65    fn default() -> Aggregation {
66        Self::Sum
67    }
68}
69