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