orvanta_api/models/evaluate_service_request.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/// EvaluateServiceRequest : Evaluate one `<decisionService>` -- the whole DRD closure below it -- as a unit (Flowable part2). Deliberately a separate shape from EvaluateRequest: a decision service has no single hit_policy and no single matched_rules, so folding it into EvaluateResponse would leave two of that schema's three required fields meaningless.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct EvaluateServiceRequest {
17 /// A saved dmn_decision path whose document holds the decision service
18 #[serde(rename = "decision_id", skip_serializing_if = "Option::is_none")]
19 pub decision_id: Option<String>,
20 /// Inline DMN 1.3 XML to evaluate instead of a saved decision_id
21 #[serde(rename = "xml", skip_serializing_if = "Option::is_none")]
22 pub xml: Option<String>,
23 /// The in-document `<decisionService id>` to run. Required: a document may hold several decision services, and picking the first would make which one ran depend on element order.
24 #[serde(rename = "decision_service_ref")]
25 pub decision_service_ref: String,
26 /// Input values keyed by FEEL variable name, flattened into dotted keys exactly as for EvaluateRequest. Each decision's result is then bound into the same context twice: under each output column's bare name (Flowable parity -- Flowable merges results flat into one shared variable map and never reads `<variable>`), and under the decision's own `<variable name>` (single output) or `<variable name>.<column>` (several outputs), which cannot collide.
27 #[serde(rename = "inputs")]
28 pub inputs: std::collections::HashMap<String, serde_json::Value>,
29}
30
31impl EvaluateServiceRequest {
32 /// Evaluate one `<decisionService>` -- the whole DRD closure below it -- as a unit (Flowable part2). Deliberately a separate shape from EvaluateRequest: a decision service has no single hit_policy and no single matched_rules, so folding it into EvaluateResponse would leave two of that schema's three required fields meaningless.
33 pub fn new(decision_service_ref: String, inputs: std::collections::HashMap<String, serde_json::Value>) -> EvaluateServiceRequest {
34 EvaluateServiceRequest {
35 decision_id: None,
36 xml: None,
37 decision_service_ref,
38 inputs,
39 }
40 }
41}
42