1use reqwest;
13use serde::{Deserialize, Serialize};
14use crate::{apis::ResponseContent, models};
15use super::{Error, configuration};
16
17
18#[derive(Debug, Clone, Serialize, Deserialize)]
20#[serde(untagged)]
21pub enum ArchiveBpmnFlowByPathError {
22 UnknownValue(serde_json::Value),
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize)]
27#[serde(untagged)]
28pub enum CreateBpmnFlowError {
29 Status400(models::BpmnValidationProblem),
30 UnknownValue(serde_json::Value),
31}
32
33#[derive(Debug, Clone, Serialize, Deserialize)]
35#[serde(untagged)]
36pub enum DeleteBpmnFlowByPathError {
37 Status400(),
38 UnknownValue(serde_json::Value),
39}
40
41#[derive(Debug, Clone, Serialize, Deserialize)]
43#[serde(untagged)]
44pub enum ExistsBpmnFlowByPathError {
45 UnknownValue(serde_json::Value),
46}
47
48#[derive(Debug, Clone, Serialize, Deserialize)]
50#[serde(untagged)]
51pub enum GetBpmnFlowByPathError {
52 UnknownValue(serde_json::Value),
53}
54
55#[derive(Debug, Clone, Serialize, Deserialize)]
57#[serde(untagged)]
58pub enum GetBpmnFlowByPathWithDraftError {
59 UnknownValue(serde_json::Value),
60}
61
62#[derive(Debug, Clone, Serialize, Deserialize)]
64#[serde(untagged)]
65pub enum GetBpmnFlowHistoryError {
66 UnknownValue(serde_json::Value),
67}
68
69#[derive(Debug, Clone, Serialize, Deserialize)]
71#[serde(untagged)]
72pub enum GetBpmnFlowVersionError {
73 UnknownValue(serde_json::Value),
74}
75
76#[derive(Debug, Clone, Serialize, Deserialize)]
78#[serde(untagged)]
79pub enum ListBpmnFlowsError {
80 UnknownValue(serde_json::Value),
81}
82
83#[derive(Debug, Clone, Serialize, Deserialize)]
85#[serde(untagged)]
86pub enum ListBpmnPathsError {
87 UnknownValue(serde_json::Value),
88}
89
90#[derive(Debug, Clone, Serialize, Deserialize)]
92#[serde(untagged)]
93pub enum ListSearchBpmnFlowError {
94 UnknownValue(serde_json::Value),
95}
96
97#[derive(Debug, Clone, Serialize, Deserialize)]
99#[serde(untagged)]
100pub enum UpdateBpmnFlowError {
101 Status400(models::BpmnValidationProblem),
102 UnknownValue(serde_json::Value),
103}
104
105
106pub async fn archive_bpmn_flow_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str, archive_flow_by_path_request: models::ArchiveFlowByPathRequest) -> Result<String, Error<ArchiveBpmnFlowByPathError>> {
107 let local_var_configuration = configuration;
108
109 let local_var_client = &local_var_configuration.client;
110
111 let local_var_uri_str = format!("{}/w/{workspace}/bpmn_flows/archive/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
112 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
113
114 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
115 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
116 }
117 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
118 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
119 };
120 local_var_req_builder = local_var_req_builder.json(&archive_flow_by_path_request);
121
122 let local_var_req = local_var_req_builder.build()?;
123 let local_var_resp = local_var_client.execute(local_var_req).await?;
124
125 let local_var_status = local_var_resp.status();
126 let local_var_content = local_var_resp.text().await?;
127
128 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
129 crate::from_str_patched(&local_var_content).map_err(Error::from)
130 } else {
131 let local_var_entity: Option<ArchiveBpmnFlowByPathError> = crate::from_str_patched(&local_var_content).ok();
132 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
133 Err(Error::ResponseError(local_var_error))
134 }
135}
136
137pub async fn create_bpmn_flow(configuration: &configuration::Configuration, workspace: &str, new_bpmn_flow: models::NewBpmnFlow) -> Result<models::BpmnDeployResult, Error<CreateBpmnFlowError>> {
138 let local_var_configuration = configuration;
139
140 let local_var_client = &local_var_configuration.client;
141
142 let local_var_uri_str = format!("{}/w/{workspace}/bpmn_flows/create", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
143 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
144
145 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
146 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
147 }
148 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
149 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
150 };
151 local_var_req_builder = local_var_req_builder.json(&new_bpmn_flow);
152
153 let local_var_req = local_var_req_builder.build()?;
154 let local_var_resp = local_var_client.execute(local_var_req).await?;
155
156 let local_var_status = local_var_resp.status();
157 let local_var_content = local_var_resp.text().await?;
158
159 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
160 crate::from_str_patched(&local_var_content).map_err(Error::from)
161 } else {
162 let local_var_entity: Option<CreateBpmnFlowError> = crate::from_str_patched(&local_var_content).ok();
163 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
164 Err(Error::ResponseError(local_var_error))
165 }
166}
167
168pub async fn delete_bpmn_flow_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<String, Error<DeleteBpmnFlowByPathError>> {
169 let local_var_configuration = configuration;
170
171 let local_var_client = &local_var_configuration.client;
172
173 let local_var_uri_str = format!("{}/w/{workspace}/bpmn_flows/delete/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
174 let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
175
176 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
177 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
178 }
179 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
180 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
181 };
182
183 let local_var_req = local_var_req_builder.build()?;
184 let local_var_resp = local_var_client.execute(local_var_req).await?;
185
186 let local_var_status = local_var_resp.status();
187 let local_var_content = local_var_resp.text().await?;
188
189 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
190 crate::from_str_patched(&local_var_content).map_err(Error::from)
191 } else {
192 let local_var_entity: Option<DeleteBpmnFlowByPathError> = crate::from_str_patched(&local_var_content).ok();
193 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
194 Err(Error::ResponseError(local_var_error))
195 }
196}
197
198pub async fn exists_bpmn_flow_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<bool, Error<ExistsBpmnFlowByPathError>> {
199 let local_var_configuration = configuration;
200
201 let local_var_client = &local_var_configuration.client;
202
203 let local_var_uri_str = format!("{}/w/{workspace}/bpmn_flows/exists/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
204 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
205
206 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
207 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
208 }
209 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
210 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
211 };
212
213 let local_var_req = local_var_req_builder.build()?;
214 let local_var_resp = local_var_client.execute(local_var_req).await?;
215
216 let local_var_status = local_var_resp.status();
217 let local_var_content = local_var_resp.text().await?;
218
219 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
220 crate::from_str_patched(&local_var_content).map_err(Error::from)
221 } else {
222 let local_var_entity: Option<ExistsBpmnFlowByPathError> = crate::from_str_patched(&local_var_content).ok();
223 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
224 Err(Error::ResponseError(local_var_error))
225 }
226}
227
228pub async fn get_bpmn_flow_by_path(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::BpmnFlow, Error<GetBpmnFlowByPathError>> {
229 let local_var_configuration = configuration;
230
231 let local_var_client = &local_var_configuration.client;
232
233 let local_var_uri_str = format!("{}/w/{workspace}/bpmn_flows/get/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
234 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
235
236 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
237 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
238 }
239 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
240 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
241 };
242
243 let local_var_req = local_var_req_builder.build()?;
244 let local_var_resp = local_var_client.execute(local_var_req).await?;
245
246 let local_var_status = local_var_resp.status();
247 let local_var_content = local_var_resp.text().await?;
248
249 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
250 crate::from_str_patched(&local_var_content).map_err(Error::from)
251 } else {
252 let local_var_entity: Option<GetBpmnFlowByPathError> = crate::from_str_patched(&local_var_content).ok();
253 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
254 Err(Error::ResponseError(local_var_error))
255 }
256}
257
258pub async fn get_bpmn_flow_by_path_with_draft(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<models::BpmnFlowWithDraft, Error<GetBpmnFlowByPathWithDraftError>> {
259 let local_var_configuration = configuration;
260
261 let local_var_client = &local_var_configuration.client;
262
263 let local_var_uri_str = format!("{}/w/{workspace}/bpmn_flows/get/draft/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
264 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
265
266 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
267 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
268 }
269 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
270 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
271 };
272
273 let local_var_req = local_var_req_builder.build()?;
274 let local_var_resp = local_var_client.execute(local_var_req).await?;
275
276 let local_var_status = local_var_resp.status();
277 let local_var_content = local_var_resp.text().await?;
278
279 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
280 crate::from_str_patched(&local_var_content).map_err(Error::from)
281 } else {
282 let local_var_entity: Option<GetBpmnFlowByPathWithDraftError> = crate::from_str_patched(&local_var_content).ok();
283 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
284 Err(Error::ResponseError(local_var_error))
285 }
286}
287
288pub async fn get_bpmn_flow_history(configuration: &configuration::Configuration, workspace: &str, path: &str) -> Result<Vec<models::BpmnFlowVersion>, Error<GetBpmnFlowHistoryError>> {
289 let local_var_configuration = configuration;
290
291 let local_var_client = &local_var_configuration.client;
292
293 let local_var_uri_str = format!("{}/w/{workspace}/bpmn_flows/history/p/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
294 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
295
296 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
297 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
298 }
299 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
300 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
301 };
302
303 let local_var_req = local_var_req_builder.build()?;
304 let local_var_resp = local_var_client.execute(local_var_req).await?;
305
306 let local_var_status = local_var_resp.status();
307 let local_var_content = local_var_resp.text().await?;
308
309 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
310 crate::from_str_patched(&local_var_content).map_err(Error::from)
311 } else {
312 let local_var_entity: Option<GetBpmnFlowHistoryError> = crate::from_str_patched(&local_var_content).ok();
313 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
314 Err(Error::ResponseError(local_var_error))
315 }
316}
317
318pub async fn get_bpmn_flow_version(configuration: &configuration::Configuration, workspace: &str, version: i32, path: &str) -> Result<models::BpmnFlow, Error<GetBpmnFlowVersionError>> {
319 let local_var_configuration = configuration;
320
321 let local_var_client = &local_var_configuration.client;
322
323 let local_var_uri_str = format!("{}/w/{workspace}/bpmn_flows/get/v/{version}/p/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), version=version, path=crate::apis::urlencode(path));
324 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
325
326 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
327 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
328 }
329 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
330 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
331 };
332
333 let local_var_req = local_var_req_builder.build()?;
334 let local_var_resp = local_var_client.execute(local_var_req).await?;
335
336 let local_var_status = local_var_resp.status();
337 let local_var_content = local_var_resp.text().await?;
338
339 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
340 crate::from_str_patched(&local_var_content).map_err(Error::from)
341 } else {
342 let local_var_entity: Option<GetBpmnFlowVersionError> = crate::from_str_patched(&local_var_content).ok();
343 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
344 Err(Error::ResponseError(local_var_error))
345 }
346}
347
348pub async fn list_bpmn_flows(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>, starred_only: Option<bool>, include_draft_only: Option<bool>, label: Option<&str>, edited_by: Option<&str>, without_description: Option<bool>) -> Result<Vec<models::ListableBpmnFlow>, Error<ListBpmnFlowsError>> {
349 let local_var_configuration = configuration;
350
351 let local_var_client = &local_var_configuration.client;
352
353 let local_var_uri_str = format!("{}/w/{workspace}/bpmn_flows/list", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
354 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
355
356 if let Some(ref local_var_str) = page {
357 local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
358 }
359 if let Some(ref local_var_str) = per_page {
360 local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
361 }
362 if let Some(ref local_var_str) = order_desc {
363 local_var_req_builder = local_var_req_builder.query(&[("order_desc", &local_var_str.to_string())]);
364 }
365 if let Some(ref local_var_str) = path_start {
366 local_var_req_builder = local_var_req_builder.query(&[("path_start", &local_var_str.to_string())]);
367 }
368 if let Some(ref local_var_str) = path_exact {
369 local_var_req_builder = local_var_req_builder.query(&[("path_exact", &local_var_str.to_string())]);
370 }
371 if let Some(ref local_var_str) = show_archived {
372 local_var_req_builder = local_var_req_builder.query(&[("show_archived", &local_var_str.to_string())]);
373 }
374 if let Some(ref local_var_str) = starred_only {
375 local_var_req_builder = local_var_req_builder.query(&[("starred_only", &local_var_str.to_string())]);
376 }
377 if let Some(ref local_var_str) = include_draft_only {
378 local_var_req_builder = local_var_req_builder.query(&[("include_draft_only", &local_var_str.to_string())]);
379 }
380 if let Some(ref local_var_str) = label {
381 local_var_req_builder = local_var_req_builder.query(&[("label", &local_var_str.to_string())]);
382 }
383 if let Some(ref local_var_str) = edited_by {
384 local_var_req_builder = local_var_req_builder.query(&[("edited_by", &local_var_str.to_string())]);
385 }
386 if let Some(ref local_var_str) = without_description {
387 local_var_req_builder = local_var_req_builder.query(&[("without_description", &local_var_str.to_string())]);
388 }
389 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
390 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
391 }
392 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
393 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
394 };
395
396 let local_var_req = local_var_req_builder.build()?;
397 let local_var_resp = local_var_client.execute(local_var_req).await?;
398
399 let local_var_status = local_var_resp.status();
400 let local_var_content = local_var_resp.text().await?;
401
402 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
403 crate::from_str_patched(&local_var_content).map_err(Error::from)
404 } else {
405 let local_var_entity: Option<ListBpmnFlowsError> = crate::from_str_patched(&local_var_content).ok();
406 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
407 Err(Error::ResponseError(local_var_error))
408 }
409}
410
411pub async fn list_bpmn_paths(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<String>, Error<ListBpmnPathsError>> {
412 let local_var_configuration = configuration;
413
414 let local_var_client = &local_var_configuration.client;
415
416 let local_var_uri_str = format!("{}/w/{workspace}/bpmn_flows/list_paths", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
417 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
418
419 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
420 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
421 }
422 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
423 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
424 };
425
426 let local_var_req = local_var_req_builder.build()?;
427 let local_var_resp = local_var_client.execute(local_var_req).await?;
428
429 let local_var_status = local_var_resp.status();
430 let local_var_content = local_var_resp.text().await?;
431
432 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
433 crate::from_str_patched(&local_var_content).map_err(Error::from)
434 } else {
435 let local_var_entity: Option<ListBpmnPathsError> = crate::from_str_patched(&local_var_content).ok();
436 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
437 Err(Error::ResponseError(local_var_error))
438 }
439}
440
441pub async fn list_search_bpmn_flow(configuration: &configuration::Configuration, workspace: &str) -> Result<Vec<models::ListSearchBpmnFlow200ResponseInner>, Error<ListSearchBpmnFlowError>> {
442 let local_var_configuration = configuration;
443
444 let local_var_client = &local_var_configuration.client;
445
446 let local_var_uri_str = format!("{}/w/{workspace}/bpmn_flows/list_search", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace));
447 let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
448
449 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
450 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
451 }
452 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
453 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
454 };
455
456 let local_var_req = local_var_req_builder.build()?;
457 let local_var_resp = local_var_client.execute(local_var_req).await?;
458
459 let local_var_status = local_var_resp.status();
460 let local_var_content = local_var_resp.text().await?;
461
462 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
463 crate::from_str_patched(&local_var_content).map_err(Error::from)
464 } else {
465 let local_var_entity: Option<ListSearchBpmnFlowError> = crate::from_str_patched(&local_var_content).ok();
466 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
467 Err(Error::ResponseError(local_var_error))
468 }
469}
470
471pub async fn update_bpmn_flow(configuration: &configuration::Configuration, workspace: &str, path: &str, new_bpmn_flow: models::NewBpmnFlow) -> Result<models::BpmnDeployResult, Error<UpdateBpmnFlowError>> {
472 let local_var_configuration = configuration;
473
474 let local_var_client = &local_var_configuration.client;
475
476 let local_var_uri_str = format!("{}/w/{workspace}/bpmn_flows/update/{path}", local_var_configuration.base_path, workspace=crate::apis::urlencode(workspace), path=crate::apis::urlencode(path));
477 let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
478
479 if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
480 local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
481 }
482 if let Some(ref local_var_token) = local_var_configuration.bearer_access_token {
483 local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
484 };
485 local_var_req_builder = local_var_req_builder.json(&new_bpmn_flow);
486
487 let local_var_req = local_var_req_builder.build()?;
488 let local_var_resp = local_var_client.execute(local_var_req).await?;
489
490 let local_var_status = local_var_resp.status();
491 let local_var_content = local_var_resp.text().await?;
492
493 if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
494 crate::from_str_patched(&local_var_content).map_err(Error::from)
495 } else {
496 let local_var_entity: Option<UpdateBpmnFlowError> = crate::from_str_patched(&local_var_content).ok();
497 let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
498 Err(Error::ResponseError(local_var_error))
499 }
500}
501