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