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 EvaluateResponse {
    #[serde(rename = "hit_policy")]
    pub hit_policy: String,
    /// The COLLECT aggregator that ran (DMN tBuiltinAggregator). Absent for every hit policy other than COLLECT, and for a plain un-aggregated COLLECT. When present, outputs holds a scalar per output column instead of the array a plain COLLECT returns. 
    #[serde(rename = "aggregation", skip_serializing_if = "Option::is_none")]
    pub aggregation: Option<Aggregation>,
    /// 1-based rule numbers, in the order the hit policy selected them
    #[serde(rename = "matched_rules")]
    pub matched_rules: Vec<i32>,
    /// Output values keyed by output column name (COLLECT yields an array per key)
    #[serde(rename = "outputs")]
    pub outputs: std::collections::HashMap<String, serde_json::Value>,
    /// Inputs that have no FEEL representation and were therefore absent from the context this decision was evaluated against, each as \"`name`: reason\". Omitted rather than fatal, so that the API and a running businessRuleTask evaluate the same decision identically. Absent when everything mapped. 
    #[serde(rename = "unmapped_inputs", skip_serializing_if = "Option::is_none")]
    pub unmapped_inputs: Option<Vec<String>>,
}

impl EvaluateResponse {
    pub fn new(hit_policy: String, matched_rules: Vec<i32>, outputs: std::collections::HashMap<String, serde_json::Value>) -> EvaluateResponse {
        EvaluateResponse {
            hit_policy,
            aggregation: None,
            matched_rules,
            outputs,
            unmapped_inputs: None,
        }
    }
}
/// The COLLECT aggregator that ran (DMN tBuiltinAggregator). Absent for every hit policy other than COLLECT, and for a plain un-aggregated COLLECT. When present, outputs holds a scalar per output column instead of the array a plain COLLECT returns. 
#[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
    }
}