Skip to main content

orvanta_api/apis/
dmn_api.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
11
12use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18/// struct for typed errors of method [`archive_dmn_decision_by_path`]
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum ArchiveDmnDecisionByPathError {
22    Status402(String),
23    UnknownValue(serde_json::Value),
24}
25
26/// struct for typed errors of method [`create_dmn_decision`]
27#[derive(Debug, Clone, Serialize, Deserialize)]
28#[serde(untagged)]
29pub enum CreateDmnDecisionError {
30    Status402(String),
31    UnknownValue(serde_json::Value),
32}
33
34/// struct for typed errors of method [`delete_dmn_decision_by_path`]
35#[derive(Debug, Clone, Serialize, Deserialize)]
36#[serde(untagged)]
37pub enum DeleteDmnDecisionByPathError {
38    Status402(String),
39    UnknownValue(serde_json::Value),
40}
41
42/// struct for typed errors of method [`evaluate_dmn_decision`]
43#[derive(Debug, Clone, Serialize, Deserialize)]
44#[serde(untagged)]
45pub enum EvaluateDmnDecisionError {
46    Status402(String),
47    UnknownValue(serde_json::Value),
48}
49
50/// struct for typed errors of method [`evaluate_dmn_decision_service`]
51#[derive(Debug, Clone, Serialize, Deserialize)]
52#[serde(untagged)]
53pub enum EvaluateDmnDecisionServiceError {
54    Status402(String),
55    UnknownValue(serde_json::Value),
56}
57
58/// struct for typed errors of method [`exists_dmn_decision_by_path`]
59#[derive(Debug, Clone, Serialize, Deserialize)]
60#[serde(untagged)]
61pub enum ExistsDmnDecisionByPathError {
62    Status402(String),
63    UnknownValue(serde_json::Value),
64}
65
66/// struct for typed errors of method [`get_dmn_decision_by_path`]
67#[derive(Debug, Clone, Serialize, Deserialize)]
68#[serde(untagged)]
69pub enum GetDmnDecisionByPathError {
70    Status402(String),
71    UnknownValue(serde_json::Value),
72}
73
74/// struct for typed errors of method [`get_dmn_decision_by_path_with_draft`]
75#[derive(Debug, Clone, Serialize, Deserialize)]
76#[serde(untagged)]
77pub enum GetDmnDecisionByPathWithDraftError {
78    Status402(String),
79    UnknownValue(serde_json::Value),
80}
81
82/// struct for typed errors of method [`get_dmn_decision_history`]
83#[derive(Debug, Clone, Serialize, Deserialize)]
84#[serde(untagged)]
85pub enum GetDmnDecisionHistoryError {
86    Status402(String),
87    UnknownValue(serde_json::Value),
88}
89
90/// struct for typed errors of method [`list_dmn_decisions`]
91#[derive(Debug, Clone, Serialize, Deserialize)]
92#[serde(untagged)]
93pub enum ListDmnDecisionsError {
94    Status402(String),
95    UnknownValue(serde_json::Value),
96}
97
98/// struct for typed errors of method [`update_dmn_decision`]
99#[derive(Debug, Clone, Serialize, Deserialize)]
100#[serde(untagged)]
101pub enum UpdateDmnDecisionError {
102    Status402(String),
103    UnknownValue(serde_json::Value),
104}
105
106
107pub async fn archive_dmn_decision_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str, archive_flow_by_path_request: models::ArchiveFlowByPathRequest) -> Result<String, Error<ArchiveDmnDecisionByPathError>> {
108    let local_var_configuration = configuration;
109
110    let local_var_client = &local_var_configuration.client;
111
112    let local_var_uri_str = format!("{}/w/{workspace}/dmn_decisions/archive/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
113    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
114
115    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
116        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
117    }
118    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
119        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
120    };
121    local_var_req_builder = local_var_req_builder.json(&archive_flow_by_path_request);
122
123    let local_var_req = local_var_req_builder.build()?;
124    let local_var_resp = local_var_client.execute(local_var_req).await?;
125
126    let local_var_status = local_var_resp.status();
127    let local_var_content = local_var_resp.text().await?;
128
129    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
130        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
131    } else {
132        let local_var_entity: Option<ArchiveDmnDecisionByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
133        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
134        Err(Error::ResponseError(local_var_error))
135    }
136}
137
138pub async fn create_dmn_decision(configuration: &configuration::Configuration, workspace: &str, new_dmn_decision: models::NewDmnDecision) -> Result<String, Error<CreateDmnDecisionError>> {
139    let local_var_configuration = configuration;
140
141    let local_var_client = &local_var_configuration.client;
142
143    let local_var_uri_str = format!("{}/w/{workspace}/dmn_decisions/create", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
144    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
145
146    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
147        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
148    }
149    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
150        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
151    };
152    local_var_req_builder = local_var_req_builder.json(&new_dmn_decision);
153
154    let local_var_req = local_var_req_builder.build()?;
155    let local_var_resp = local_var_client.execute(local_var_req).await?;
156
157    let local_var_status = local_var_resp.status();
158    let local_var_content = local_var_resp.text().await?;
159
160    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
161        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
162    } else {
163        let local_var_entity: Option<CreateDmnDecisionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
164        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
165        Err(Error::ResponseError(local_var_error))
166    }
167}
168
169pub async fn delete_dmn_decision_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<DeleteDmnDecisionByPathError>> {
170    let local_var_configuration = configuration;
171
172    let local_var_client = &local_var_configuration.client;
173
174    let local_var_uri_str = format!("{}/w/{workspace}/dmn_decisions/delete/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
175    let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
176
177    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
178        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
179    }
180    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
181        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
182    };
183
184    let local_var_req = local_var_req_builder.build()?;
185    let local_var_resp = local_var_client.execute(local_var_req).await?;
186
187    let local_var_status = local_var_resp.status();
188    let local_var_content = local_var_resp.text().await?;
189
190    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
191        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
192    } else {
193        let local_var_entity: Option<DeleteDmnDecisionByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
194        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
195        Err(Error::ResponseError(local_var_error))
196    }
197}
198
199/// Evaluate a saved decision (decision_id, no inline xml) or an inline document (xml, with decision_id optional). These two cases use decision_id differently: when evaluating a stored decision, decision_id is purely the storage path used to load the XML, not a selector into it. For inline xml, decision_id doubles as an in-document `<decision id>` selector, since the storage path and the document's internal decision id are unrelated namespaces. To select a specific decision inside the document explicitly -- including a non-first decision in a saved multi-decision document -- supply decision_ref, which is always the in-document selector regardless of branch. An archived stored decision cannot be evaluated (400). 
200pub async fn evaluate_dmn_decision(configuration: &configuration::Configuration, workspace: &str, evaluate_request: models::EvaluateRequest) -> Result<models::EvaluateResponse, Error<EvaluateDmnDecisionError>> {
201    let local_var_configuration = configuration;
202
203    let local_var_client = &local_var_configuration.client;
204
205    let local_var_uri_str = format!("{}/w/{workspace}/dmn_decisions/evaluate", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
206    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
207
208    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
209        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
210    }
211    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
212        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
213    };
214    local_var_req_builder = local_var_req_builder.json(&evaluate_request);
215
216    let local_var_req = local_var_req_builder.build()?;
217    let local_var_resp = local_var_client.execute(local_var_req).await?;
218
219    let local_var_status = local_var_resp.status();
220    let local_var_content = local_var_resp.text().await?;
221
222    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
223        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
224    } else {
225        let local_var_entity: Option<EvaluateDmnDecisionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
226        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
227        Err(Error::ResponseError(local_var_error))
228    }
229}
230
231/// Evaluate one `<decisionService>` in a DMN document as a unit -- the output decisions whose results compose the service result, plus the encapsulated decisions that feed them, ordered by their `<informationRequirement>` edges.  The document comes from a saved decision_id or from inline xml (xml wins when both are present); decision_service_ref always names the `<decisionService id>` inside it. An archived stored decision cannot be evaluated (400).  Malformed graphs are named, never silently empty: a required-decision cycle, an href pointing at an id nothing defines, an href into another document, a decision reached but listed in neither the output nor the encapsulated section, a decision with no `<decisionTable>` or no `<variable>`, and duplicate element ids all return 400 with the offending ids. 
232pub async fn evaluate_dmn_decision_service(configuration: &configuration::Configuration, workspace: &str, evaluate_service_request: models::EvaluateServiceRequest) -> Result<models::EvaluateServiceResponse, Error<EvaluateDmnDecisionServiceError>> {
233    let local_var_configuration = configuration;
234
235    let local_var_client = &local_var_configuration.client;
236
237    let local_var_uri_str = format!("{}/w/{workspace}/dmn_decisions/evaluate_service", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
238    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
239
240    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
241        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
242    }
243    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
244        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
245    };
246    local_var_req_builder = local_var_req_builder.json(&evaluate_service_request);
247
248    let local_var_req = local_var_req_builder.build()?;
249    let local_var_resp = local_var_client.execute(local_var_req).await?;
250
251    let local_var_status = local_var_resp.status();
252    let local_var_content = local_var_resp.text().await?;
253
254    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
255        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
256    } else {
257        let local_var_entity: Option<EvaluateDmnDecisionServiceError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
258        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
259        Err(Error::ResponseError(local_var_error))
260    }
261}
262
263pub async fn exists_dmn_decision_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<bool, Error<ExistsDmnDecisionByPathError>> {
264    let local_var_configuration = configuration;
265
266    let local_var_client = &local_var_configuration.client;
267
268    let local_var_uri_str = format!("{}/w/{workspace}/dmn_decisions/exists/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
269    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
270
271    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
272        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
273    }
274    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
275        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
276    };
277
278    let local_var_req = local_var_req_builder.build()?;
279    let local_var_resp = local_var_client.execute(local_var_req).await?;
280
281    let local_var_status = local_var_resp.status();
282    let local_var_content = local_var_resp.text().await?;
283
284    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
285        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
286    } else {
287        let local_var_entity: Option<ExistsDmnDecisionByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
288        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
289        Err(Error::ResponseError(local_var_error))
290    }
291}
292
293pub async fn get_dmn_decision_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::DmnDecision, Error<GetDmnDecisionByPathError>> {
294    let local_var_configuration = configuration;
295
296    let local_var_client = &local_var_configuration.client;
297
298    let local_var_uri_str = format!("{}/w/{workspace}/dmn_decisions/get/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
299    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
300
301    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
302        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
303    }
304    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
305        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
306    };
307
308    let local_var_req = local_var_req_builder.build()?;
309    let local_var_resp = local_var_client.execute(local_var_req).await?;
310
311    let local_var_status = local_var_resp.status();
312    let local_var_content = local_var_resp.text().await?;
313
314    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
315        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
316    } else {
317        let local_var_entity: Option<GetDmnDecisionByPathError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
318        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
319        Err(Error::ResponseError(local_var_error))
320    }
321}
322
323pub async fn get_dmn_decision_by_path_with_draft(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::DmnDecisionWithDraft, Error<GetDmnDecisionByPathWithDraftError>> {
324    let local_var_configuration = configuration;
325
326    let local_var_client = &local_var_configuration.client;
327
328    let local_var_uri_str = format!("{}/w/{workspace}/dmn_decisions/get/draft/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
329    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
330
331    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
332        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
333    }
334    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
335        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
336    };
337
338    let local_var_req = local_var_req_builder.build()?;
339    let local_var_resp = local_var_client.execute(local_var_req).await?;
340
341    let local_var_status = local_var_resp.status();
342    let local_var_content = local_var_resp.text().await?;
343
344    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
345        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
346    } else {
347        let local_var_entity: Option<GetDmnDecisionByPathWithDraftError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
348        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
349        Err(Error::ResponseError(local_var_error))
350    }
351}
352
353pub async fn get_dmn_decision_history(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<Vec<models::DmnDecisionVersion>, Error<GetDmnDecisionHistoryError>> {
354    let local_var_configuration = configuration;
355
356    let local_var_client = &local_var_configuration.client;
357
358    let local_var_uri_str = format!("{}/w/{workspace}/dmn_decisions/history/p/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
359    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
360
361    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
362        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
363    }
364    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
365        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
366    };
367
368    let local_var_req = local_var_req_builder.build()?;
369    let local_var_resp = local_var_client.execute(local_var_req).await?;
370
371    let local_var_status = local_var_resp.status();
372    let local_var_content = local_var_resp.text().await?;
373
374    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
375        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
376    } else {
377        let local_var_entity: Option<GetDmnDecisionHistoryError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
378        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
379        Err(Error::ResponseError(local_var_error))
380    }
381}
382
383pub async fn list_dmn_decisions(configuration: &configuration::Configuration, workspace: &str, page: Option<i32>, per_page: Option<i32>, order_desc: Option<bool>, path_start: Option<&str>, path_exact: Option<&str>, show_archived: Option<bool>, include_draft_only: Option<bool>, label: Option<&str>, edited_by: Option<&str>, without_description: Option<bool>) -> Result<Vec<models::ListableDmnDecision>, Error<ListDmnDecisionsError>> {
384    let local_var_configuration = configuration;
385
386    let local_var_client = &local_var_configuration.client;
387
388    let local_var_uri_str = format!("{}/w/{workspace}/dmn_decisions/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
389    let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
390
391    if let Some(ref local_var_str) = page {
392        local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
393    }
394    if let Some(ref local_var_str) = per_page {
395        local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
396    }
397    if let Some(ref local_var_str) = order_desc {
398        local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
399    }
400    if let Some(ref local_var_str) = path_start {
401        local_var_req_builder = local_var_req_builder.query(&[("path_start", &local_var_str.to_string())]);
402    }
403    if let Some(ref local_var_str) = path_exact {
404        local_var_req_builder = local_var_req_builder.query(&[("path_exact", &local_var_str.to_string())]);
405    }
406    if let Some(ref local_var_str) = show_archived {
407        local_var_req_builder = local_var_req_builder.query(&[("show_archived", &local_var_str.to_string())]);
408    }
409    if let Some(ref local_var_str) = include_draft_only {
410        local_var_req_builder = local_var_req_builder.query(&[("include_draft_only", &local_var_str.to_string())]);
411    }
412    if let Some(ref local_var_str) = label {
413        local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
414    }
415    if let Some(ref local_var_str) = edited_by {
416        local_var_req_builder = local_var_req_builder.query(&[("edited_by", &local_var_str.to_string())]);
417    }
418    if let Some(ref local_var_str) = without_description {
419        local_var_req_builder = local_var_req_builder.query(&[("without_description", &local_var_str.to_string())]);
420    }
421    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
422        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
423    }
424    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
425        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
426    };
427
428    let local_var_req = local_var_req_builder.build()?;
429    let local_var_resp = local_var_client.execute(local_var_req).await?;
430
431    let local_var_status = local_var_resp.status();
432    let local_var_content = local_var_resp.text().await?;
433
434    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
435        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
436    } else {
437        let local_var_entity: Option<ListDmnDecisionsError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
438        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
439        Err(Error::ResponseError(local_var_error))
440    }
441}
442
443pub async fn update_dmn_decision(configuration: &configuration::Configuration, workspace: &str, path: &str, new_dmn_decision: models::NewDmnDecision) -> Result<String, Error<UpdateDmnDecisionError>> {
444    let local_var_configuration = configuration;
445
446    let local_var_client = &local_var_configuration.client;
447
448    let local_var_uri_str = format!("{}/w/{workspace}/dmn_decisions/update/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
449    let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
450
451    if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
452        local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
453    }
454    if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
455        local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
456    };
457    local_var_req_builder = local_var_req_builder.json(&new_dmn_decision);
458
459    let local_var_req = local_var_req_builder.build()?;
460    let local_var_resp = local_var_client.execute(local_var_req).await?;
461
462    let local_var_status = local_var_resp.status();
463    let local_var_content = local_var_resp.text().await?;
464
465    if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
466        crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).map_err(Error::from)
467    } else {
468        let local_var_entity: Option<UpdateDmnDecisionError> = crate::from_str_patched/* Externally injected from /build.nu */(&local_var_content).ok();
469        let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
470        Err(Error::ResponseError(local_var_error))
471    }
472}
473