Skip to main content

orvanta_api/models/
evaluate_response.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: 2.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 EvaluateResponse {
16    #[serde(rename = "hit_policy")]
17    pub hit_policy: String,
18    /// 1-based rule numbers, in the order the hit policy selected them
19    #[serde(rename = "matched_rules")]
20    pub matched_rules: Vec<i32>,
21    /// Output values keyed by output column name (COLLECT yields an array per key)
22    #[serde(rename = "outputs")]
23    pub outputs: std::collections::HashMap<String, serde_json::Value>,
24    /// 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. 
25    #[serde(rename = "unmapped_inputs", skip_serializing_if = "Option::is_none")]
26    pub unmapped_inputs: Option<Vec<String>>,
27}
28
29impl EvaluateResponse {
30    pub fn new(hit_policy: String, matched_rules: Vec<i32>, outputs: std::collections::HashMap<String, serde_json::Value>) -> EvaluateResponse {
31        EvaluateResponse {
32            hit_policy,
33            matched_rules,
34            outputs,
35            unmapped_inputs: None,
36        }
37    }
38}
39