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 EvaluateServiceResponse {
    #[serde(rename = "service_id")]
    pub service_id: String,
    /// One `<outputDecision>` returns that decision's value directly; several return an object keyed by each one's `<variable name>`. 
    #[serde(rename = "outputs", deserialize_with = "Option::deserialize")]
    pub outputs: Option<serde_json::Value>,
    /// 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. 
    #[serde(rename = "decisions")]
    pub decisions: Vec<models::EvaluatedDecisionSummary>,
    /// 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. 
    #[serde(rename = "missing_inputs", skip_serializing_if = "Option::is_none")]
    pub missing_inputs: Option<Vec<String>>,
    /// 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. 
    #[serde(rename = "shadowed_variables", skip_serializing_if = "Option::is_none")]
    pub shadowed_variables: Option<Vec<String>>,
    #[serde(rename = "unmapped_inputs", skip_serializing_if = "Option::is_none")]
    pub unmapped_inputs: Option<Vec<String>>,
}

impl EvaluateServiceResponse {
    pub fn new(service_id: String, outputs: Option<serde_json::Value>, decisions: Vec<models::EvaluatedDecisionSummary>) -> EvaluateServiceResponse {
        EvaluateServiceResponse {
            service_id,
            outputs,
            decisions,
            missing_inputs: None,
            shadowed_variables: None,
            unmapped_inputs: None,
        }
    }
}