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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EvaluatedDecisionSummary {
    #[serde(rename = "decision_id")]
    pub decision_id: String,
    #[serde(rename = "decision_name")]
    pub decision_name: String,
    /// The `<variable name>` this decision's result was bound under
    #[serde(rename = "variable")]
    pub variable: String,
    /// True for an `<outputDecision>` of the service, false for an `<encapsulatedDecision>` whose result feeds other decisions but is not returned. 
    #[serde(rename = "is_output")]
    pub is_output: bool,
    #[serde(rename = "hit_policy")]
    pub hit_policy: String,
    #[serde(rename = "aggregation", skip_serializing_if = "Option::is_none")]
    pub aggregation: Option<Aggregation>,
    #[serde(rename = "matched_rules")]
    pub matched_rules: Vec<i32>,
    /// 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). 
    #[serde(rename = "value", deserialize_with = "Option::deserialize")]
    pub value: Option<serde_json::Value>,
}

impl EvaluatedDecisionSummary {
    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 {
        EvaluatedDecisionSummary {
            decision_id,
            decision_name,
            variable,
            is_output,
            hit_policy,
            aggregation: None,
            matched_rules,
            value,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Aggregation {
    #[serde(rename = "SUM")]
    Sum,
    #[serde(rename = "MIN")]
    Min,
    #[serde(rename = "MAX")]
    Max,
    #[serde(rename = "COUNT")]
    Count,
}

impl Default for Aggregation {
    fn default() -> Aggregation {
        Self::Sum
    }
}