Skip to main content

orvanta_api/models/
evaluate_service_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: 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 EvaluateServiceResponse {
16    #[serde(rename = "service_id")]
17    pub service_id: String,
18    /// One `<outputDecision>` returns that decision's value directly; several return an object keyed by each one's `<variable name>`. 
19    #[serde(rename = "outputs", deserialize_with = "Option::deserialize")]
20    pub outputs: Option<serde_json::Value>,
21    /// Every decision that ran, in topological order -- the audit trail of a DRD run, and the only way to see why an output came out as it did when several tables fed into it. 
22    #[serde(rename = "decisions")]
23    pub decisions: Vec<models::EvaluatedDecisionSummary>,
24    /// Declared `<inputData>` that a decision in the closure required via a `<requiredInput>` edge but that the request did not supply. A warning, not an error: a missing name evaluates to null, exactly as everywhere else in this engine. 
25    #[serde(rename = "missing_inputs", skip_serializing_if = "Option::is_none")]
26    pub missing_inputs: Option<Vec<String>>,
27    /// Bare output-column names that one decision's result overwrote after an earlier decision (or the request) had already bound them. This is Flowable's documented behaviour -- one shared variable map, last write wins -- kept for parity but reported rather than silent. The namespaced `<variable name>` binding is unaffected, so the shadowed value is still reachable. 
28    #[serde(rename = "shadowed_variables", skip_serializing_if = "Option::is_none")]
29    pub shadowed_variables: Option<Vec<String>>,
30    #[serde(rename = "unmapped_inputs", skip_serializing_if = "Option::is_none")]
31    pub unmapped_inputs: Option<Vec<String>>,
32}
33
34impl EvaluateServiceResponse {
35    pub fn new(service_id: String, outputs: Option<serde_json::Value>, decisions: Vec<models::EvaluatedDecisionSummary>) -> EvaluateServiceResponse {
36        EvaluateServiceResponse {
37            service_id,
38            outputs,
39            decisions,
40            missing_inputs: None,
41            shadowed_variables: None,
42            unmapped_inputs: None,
43        }
44    }
45}
46