camunda_client/apis/
external_task_api.rs

1/*
2 * Camunda BPM REST API
3 *
4 * OpenApi Spec for Camunda BPM REST API.
5 *
6 * The version of the OpenAPI document: 7.13.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use std::rc::Rc;
12use std::borrow::Borrow;
13#[allow(unused_imports)]
14use std::option::Option;
15
16use reqwest;
17
18use super::{Error, configuration};
19
20pub struct ExternalTaskApiClient {
21    configuration: Rc<configuration::Configuration>,
22}
23
24impl ExternalTaskApiClient {
25    pub fn new(configuration: Rc<configuration::Configuration>) -> ExternalTaskApiClient {
26        ExternalTaskApiClient {
27            configuration,
28        }
29    }
30}
31
32pub trait ExternalTaskApi {
33    fn complete_external_task_resource(&self, id: &str, complete_external_task_dto: Option<crate::models::CompleteExternalTaskDto>) -> Result<(), Error>;
34    fn extend_lock(&self, id: &str, extend_lock_on_external_task_dto: Option<crate::models::ExtendLockOnExternalTaskDto>) -> Result<(), Error>;
35    fn fetch_and_lock(&self, fetch_external_tasks_dto: Option<crate::models::FetchExternalTasksDto>) -> Result<Vec<crate::models::LockedExternalTaskDto>, Error>;
36    fn get_external_task(&self, id: &str) -> Result<crate::models::ExternalTaskDto, Error>;
37    fn get_external_task_error_details(&self, id: &str) -> Result<String, Error>;
38    fn get_external_tasks(&self, external_task_id: Option<&str>, external_task_id_in: Option<&str>, topic_name: Option<&str>, worker_id: Option<&str>, locked: Option<bool>, not_locked: Option<bool>, with_retries_left: Option<bool>, no_retries_left: Option<bool>, lock_expiration_after: Option<String>, lock_expiration_before: Option<String>, activity_id: Option<&str>, activity_id_in: Option<&str>, execution_id: Option<&str>, process_instance_id: Option<&str>, process_instance_id_in: Option<&str>, process_definition_id: Option<&str>, tenant_id_in: Option<&str>, active: Option<bool>, suspended: Option<bool>, priority_higher_than_or_equals: Option<i64>, priority_lower_than_or_equals: Option<i64>, sort_by: Option<&str>, sort_order: Option<&str>, first_result: Option<i32>, max_results: Option<i32>) -> Result<Vec<crate::models::ExternalTaskDto>, Error>;
39    fn get_external_tasks_count(&self, external_task_id: Option<&str>, external_task_id_in: Option<&str>, topic_name: Option<&str>, worker_id: Option<&str>, locked: Option<bool>, not_locked: Option<bool>, with_retries_left: Option<bool>, no_retries_left: Option<bool>, lock_expiration_after: Option<String>, lock_expiration_before: Option<String>, activity_id: Option<&str>, activity_id_in: Option<&str>, execution_id: Option<&str>, process_instance_id: Option<&str>, process_instance_id_in: Option<&str>, process_definition_id: Option<&str>, tenant_id_in: Option<&str>, active: Option<bool>, suspended: Option<bool>, priority_higher_than_or_equals: Option<i64>, priority_lower_than_or_equals: Option<i64>) -> Result<crate::models::CountResultDto, Error>;
40    fn get_topic_names(&self, with_locked_tasks: Option<bool>, with_unlocked_tasks: Option<bool>, with_retries_left: Option<bool>) -> Result<Vec<String>, Error>;
41    fn handle_external_task_bpmn_error(&self, id: &str, external_task_bpmn_error: Option<crate::models::ExternalTaskBpmnError>) -> Result<(), Error>;
42    fn handle_failure(&self, id: &str, external_task_failure_dto: Option<crate::models::ExternalTaskFailureDto>) -> Result<(), Error>;
43    fn query_external_tasks(&self, first_result: Option<i32>, max_results: Option<i32>, external_task_query_dto: Option<crate::models::ExternalTaskQueryDto>) -> Result<Vec<crate::models::ExternalTaskDto>, Error>;
44    fn query_external_tasks_count(&self, external_task_query_dto: Option<crate::models::ExternalTaskQueryDto>) -> Result<crate::models::CountResultDto, Error>;
45    fn set_external_task_resource_priority(&self, id: &str, priority_dto: Option<crate::models::PriorityDto>) -> Result<(), Error>;
46    fn set_external_task_resource_retries(&self, id: &str, retries_dto: Option<crate::models::RetriesDto>) -> Result<(), Error>;
47    fn set_external_task_retries(&self, set_retries_for_external_tasks_dto: Option<crate::models::SetRetriesForExternalTasksDto>) -> Result<(), Error>;
48    fn set_external_task_retries_async_operation(&self, set_retries_for_external_tasks_dto: Option<crate::models::SetRetriesForExternalTasksDto>) -> Result<crate::models::BatchDto, Error>;
49    fn unlock(&self, id: &str) -> Result<(), Error>;
50}
51
52impl ExternalTaskApi for ExternalTaskApiClient {
53    fn complete_external_task_resource(&self, id: &str, complete_external_task_dto: Option<crate::models::CompleteExternalTaskDto>) -> Result<(), Error> {
54        let configuration: &configuration::Configuration = self.configuration.borrow();
55        let client = &configuration.client;
56
57        let uri_str = format!("{}/external-task/{id}/complete", configuration.base_path, id=crate::apis::urlencode(id));
58        let mut req_builder = client.post(uri_str.as_str());
59
60        if let Some(ref user_agent) = configuration.user_agent {
61            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
62        }
63        req_builder = req_builder.json(&complete_external_task_dto);
64
65        // send request
66        let req = req_builder.build()?;
67
68        client.execute(req)?.error_for_status()?;
69        Ok(())
70    }
71
72    fn extend_lock(&self, id: &str, extend_lock_on_external_task_dto: Option<crate::models::ExtendLockOnExternalTaskDto>) -> Result<(), Error> {
73        let configuration: &configuration::Configuration = self.configuration.borrow();
74        let client = &configuration.client;
75
76        let uri_str = format!("{}/external-task/{id}/extendLock", configuration.base_path, id=crate::apis::urlencode(id));
77        let mut req_builder = client.post(uri_str.as_str());
78
79        if let Some(ref user_agent) = configuration.user_agent {
80            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
81        }
82        req_builder = req_builder.json(&extend_lock_on_external_task_dto);
83
84        // send request
85        let req = req_builder.build()?;
86
87        client.execute(req)?.error_for_status()?;
88        Ok(())
89    }
90
91    fn fetch_and_lock(&self, fetch_external_tasks_dto: Option<crate::models::FetchExternalTasksDto>) -> Result<Vec<crate::models::LockedExternalTaskDto>, Error> {
92        let configuration: &configuration::Configuration = self.configuration.borrow();
93        let client = &configuration.client;
94
95        let uri_str = format!("{}/external-task/fetchAndLock", configuration.base_path);
96        let mut req_builder = client.post(uri_str.as_str());
97
98        if let Some(ref user_agent) = configuration.user_agent {
99            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
100        }
101        req_builder = req_builder.json(&fetch_external_tasks_dto);
102
103        // send request
104        let req = req_builder.build()?;
105
106        Ok(client.execute(req)?.error_for_status()?.json()?)
107    }
108
109    fn get_external_task(&self, id: &str) -> Result<crate::models::ExternalTaskDto, Error> {
110        let configuration: &configuration::Configuration = self.configuration.borrow();
111        let client = &configuration.client;
112
113        let uri_str = format!("{}/external-task/{id}", configuration.base_path, id=crate::apis::urlencode(id));
114        let mut req_builder = client.get(uri_str.as_str());
115
116        if let Some(ref user_agent) = configuration.user_agent {
117            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
118        }
119
120        // send request
121        let req = req_builder.build()?;
122
123        Ok(client.execute(req)?.error_for_status()?.json()?)
124    }
125
126    fn get_external_task_error_details(&self, id: &str) -> Result<String, Error> {
127        let configuration: &configuration::Configuration = self.configuration.borrow();
128        let client = &configuration.client;
129
130        let uri_str = format!("{}/external-task/{id}/errorDetails", configuration.base_path, id=crate::apis::urlencode(id));
131        let mut req_builder = client.get(uri_str.as_str());
132
133        if let Some(ref user_agent) = configuration.user_agent {
134            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
135        }
136
137        // send request
138        let req = req_builder.build()?;
139
140        Ok(client.execute(req)?.error_for_status()?.json()?)
141    }
142
143    fn get_external_tasks(&self, external_task_id: Option<&str>, external_task_id_in: Option<&str>, topic_name: Option<&str>, worker_id: Option<&str>, locked: Option<bool>, not_locked: Option<bool>, with_retries_left: Option<bool>, no_retries_left: Option<bool>, lock_expiration_after: Option<String>, lock_expiration_before: Option<String>, activity_id: Option<&str>, activity_id_in: Option<&str>, execution_id: Option<&str>, process_instance_id: Option<&str>, process_instance_id_in: Option<&str>, process_definition_id: Option<&str>, tenant_id_in: Option<&str>, active: Option<bool>, suspended: Option<bool>, priority_higher_than_or_equals: Option<i64>, priority_lower_than_or_equals: Option<i64>, sort_by: Option<&str>, sort_order: Option<&str>, first_result: Option<i32>, max_results: Option<i32>) -> Result<Vec<crate::models::ExternalTaskDto>, Error> {
144        let configuration: &configuration::Configuration = self.configuration.borrow();
145        let client = &configuration.client;
146
147        let uri_str = format!("{}/external-task", configuration.base_path);
148        let mut req_builder = client.get(uri_str.as_str());
149
150        if let Some(ref s) = external_task_id {
151            req_builder = req_builder.query(&[("externalTaskId", &s.to_string())]);
152        }
153        if let Some(ref s) = external_task_id_in {
154            req_builder = req_builder.query(&[("externalTaskIdIn", &s.to_string())]);
155        }
156        if let Some(ref s) = topic_name {
157            req_builder = req_builder.query(&[("topicName", &s.to_string())]);
158        }
159        if let Some(ref s) = worker_id {
160            req_builder = req_builder.query(&[("workerId", &s.to_string())]);
161        }
162        if let Some(ref s) = locked {
163            req_builder = req_builder.query(&[("locked", &s.to_string())]);
164        }
165        if let Some(ref s) = not_locked {
166            req_builder = req_builder.query(&[("notLocked", &s.to_string())]);
167        }
168        if let Some(ref s) = with_retries_left {
169            req_builder = req_builder.query(&[("withRetriesLeft", &s.to_string())]);
170        }
171        if let Some(ref s) = no_retries_left {
172            req_builder = req_builder.query(&[("noRetriesLeft", &s.to_string())]);
173        }
174        if let Some(ref s) = lock_expiration_after {
175            req_builder = req_builder.query(&[("lockExpirationAfter", &s.to_string())]);
176        }
177        if let Some(ref s) = lock_expiration_before {
178            req_builder = req_builder.query(&[("lockExpirationBefore", &s.to_string())]);
179        }
180        if let Some(ref s) = activity_id {
181            req_builder = req_builder.query(&[("activityId", &s.to_string())]);
182        }
183        if let Some(ref s) = activity_id_in {
184            req_builder = req_builder.query(&[("activityIdIn", &s.to_string())]);
185        }
186        if let Some(ref s) = execution_id {
187            req_builder = req_builder.query(&[("executionId", &s.to_string())]);
188        }
189        if let Some(ref s) = process_instance_id {
190            req_builder = req_builder.query(&[("processInstanceId", &s.to_string())]);
191        }
192        if let Some(ref s) = process_instance_id_in {
193            req_builder = req_builder.query(&[("processInstanceIdIn", &s.to_string())]);
194        }
195        if let Some(ref s) = process_definition_id {
196            req_builder = req_builder.query(&[("processDefinitionId", &s.to_string())]);
197        }
198        if let Some(ref s) = tenant_id_in {
199            req_builder = req_builder.query(&[("tenantIdIn", &s.to_string())]);
200        }
201        if let Some(ref s) = active {
202            req_builder = req_builder.query(&[("active", &s.to_string())]);
203        }
204        if let Some(ref s) = suspended {
205            req_builder = req_builder.query(&[("suspended", &s.to_string())]);
206        }
207        if let Some(ref s) = priority_higher_than_or_equals {
208            req_builder = req_builder.query(&[("priorityHigherThanOrEquals", &s.to_string())]);
209        }
210        if let Some(ref s) = priority_lower_than_or_equals {
211            req_builder = req_builder.query(&[("priorityLowerThanOrEquals", &s.to_string())]);
212        }
213        if let Some(ref s) = sort_by {
214            req_builder = req_builder.query(&[("sortBy", &s.to_string())]);
215        }
216        if let Some(ref s) = sort_order {
217            req_builder = req_builder.query(&[("sortOrder", &s.to_string())]);
218        }
219        if let Some(ref s) = first_result {
220            req_builder = req_builder.query(&[("firstResult", &s.to_string())]);
221        }
222        if let Some(ref s) = max_results {
223            req_builder = req_builder.query(&[("maxResults", &s.to_string())]);
224        }
225        if let Some(ref user_agent) = configuration.user_agent {
226            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
227        }
228
229        // send request
230        let req = req_builder.build()?;
231
232        Ok(client.execute(req)?.error_for_status()?.json()?)
233    }
234
235    fn get_external_tasks_count(&self, external_task_id: Option<&str>, external_task_id_in: Option<&str>, topic_name: Option<&str>, worker_id: Option<&str>, locked: Option<bool>, not_locked: Option<bool>, with_retries_left: Option<bool>, no_retries_left: Option<bool>, lock_expiration_after: Option<String>, lock_expiration_before: Option<String>, activity_id: Option<&str>, activity_id_in: Option<&str>, execution_id: Option<&str>, process_instance_id: Option<&str>, process_instance_id_in: Option<&str>, process_definition_id: Option<&str>, tenant_id_in: Option<&str>, active: Option<bool>, suspended: Option<bool>, priority_higher_than_or_equals: Option<i64>, priority_lower_than_or_equals: Option<i64>) -> Result<crate::models::CountResultDto, Error> {
236        let configuration: &configuration::Configuration = self.configuration.borrow();
237        let client = &configuration.client;
238
239        let uri_str = format!("{}/external-task/count", configuration.base_path);
240        let mut req_builder = client.get(uri_str.as_str());
241
242        if let Some(ref s) = external_task_id {
243            req_builder = req_builder.query(&[("externalTaskId", &s.to_string())]);
244        }
245        if let Some(ref s) = external_task_id_in {
246            req_builder = req_builder.query(&[("externalTaskIdIn", &s.to_string())]);
247        }
248        if let Some(ref s) = topic_name {
249            req_builder = req_builder.query(&[("topicName", &s.to_string())]);
250        }
251        if let Some(ref s) = worker_id {
252            req_builder = req_builder.query(&[("workerId", &s.to_string())]);
253        }
254        if let Some(ref s) = locked {
255            req_builder = req_builder.query(&[("locked", &s.to_string())]);
256        }
257        if let Some(ref s) = not_locked {
258            req_builder = req_builder.query(&[("notLocked", &s.to_string())]);
259        }
260        if let Some(ref s) = with_retries_left {
261            req_builder = req_builder.query(&[("withRetriesLeft", &s.to_string())]);
262        }
263        if let Some(ref s) = no_retries_left {
264            req_builder = req_builder.query(&[("noRetriesLeft", &s.to_string())]);
265        }
266        if let Some(ref s) = lock_expiration_after {
267            req_builder = req_builder.query(&[("lockExpirationAfter", &s.to_string())]);
268        }
269        if let Some(ref s) = lock_expiration_before {
270            req_builder = req_builder.query(&[("lockExpirationBefore", &s.to_string())]);
271        }
272        if let Some(ref s) = activity_id {
273            req_builder = req_builder.query(&[("activityId", &s.to_string())]);
274        }
275        if let Some(ref s) = activity_id_in {
276            req_builder = req_builder.query(&[("activityIdIn", &s.to_string())]);
277        }
278        if let Some(ref s) = execution_id {
279            req_builder = req_builder.query(&[("executionId", &s.to_string())]);
280        }
281        if let Some(ref s) = process_instance_id {
282            req_builder = req_builder.query(&[("processInstanceId", &s.to_string())]);
283        }
284        if let Some(ref s) = process_instance_id_in {
285            req_builder = req_builder.query(&[("processInstanceIdIn", &s.to_string())]);
286        }
287        if let Some(ref s) = process_definition_id {
288            req_builder = req_builder.query(&[("processDefinitionId", &s.to_string())]);
289        }
290        if let Some(ref s) = tenant_id_in {
291            req_builder = req_builder.query(&[("tenantIdIn", &s.to_string())]);
292        }
293        if let Some(ref s) = active {
294            req_builder = req_builder.query(&[("active", &s.to_string())]);
295        }
296        if let Some(ref s) = suspended {
297            req_builder = req_builder.query(&[("suspended", &s.to_string())]);
298        }
299        if let Some(ref s) = priority_higher_than_or_equals {
300            req_builder = req_builder.query(&[("priorityHigherThanOrEquals", &s.to_string())]);
301        }
302        if let Some(ref s) = priority_lower_than_or_equals {
303            req_builder = req_builder.query(&[("priorityLowerThanOrEquals", &s.to_string())]);
304        }
305        if let Some(ref user_agent) = configuration.user_agent {
306            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
307        }
308
309        // send request
310        let req = req_builder.build()?;
311
312        Ok(client.execute(req)?.error_for_status()?.json()?)
313    }
314
315    fn get_topic_names(&self, with_locked_tasks: Option<bool>, with_unlocked_tasks: Option<bool>, with_retries_left: Option<bool>) -> Result<Vec<String>, Error> {
316        let configuration: &configuration::Configuration = self.configuration.borrow();
317        let client = &configuration.client;
318
319        let uri_str = format!("{}/external-task/topic-names", configuration.base_path);
320        let mut req_builder = client.get(uri_str.as_str());
321
322        if let Some(ref s) = with_locked_tasks {
323            req_builder = req_builder.query(&[("withLockedTasks", &s.to_string())]);
324        }
325        if let Some(ref s) = with_unlocked_tasks {
326            req_builder = req_builder.query(&[("withUnlockedTasks", &s.to_string())]);
327        }
328        if let Some(ref s) = with_retries_left {
329            req_builder = req_builder.query(&[("withRetriesLeft", &s.to_string())]);
330        }
331        if let Some(ref user_agent) = configuration.user_agent {
332            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
333        }
334
335        // send request
336        let req = req_builder.build()?;
337
338        Ok(client.execute(req)?.error_for_status()?.json()?)
339    }
340
341    fn handle_external_task_bpmn_error(&self, id: &str, external_task_bpmn_error: Option<crate::models::ExternalTaskBpmnError>) -> Result<(), Error> {
342        let configuration: &configuration::Configuration = self.configuration.borrow();
343        let client = &configuration.client;
344
345        let uri_str = format!("{}/external-task/{id}/bpmnError", configuration.base_path, id=crate::apis::urlencode(id));
346        let mut req_builder = client.post(uri_str.as_str());
347
348        if let Some(ref user_agent) = configuration.user_agent {
349            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
350        }
351        req_builder = req_builder.json(&external_task_bpmn_error);
352
353        // send request
354        let req = req_builder.build()?;
355
356        client.execute(req)?.error_for_status()?;
357        Ok(())
358    }
359
360    fn handle_failure(&self, id: &str, external_task_failure_dto: Option<crate::models::ExternalTaskFailureDto>) -> Result<(), Error> {
361        let configuration: &configuration::Configuration = self.configuration.borrow();
362        let client = &configuration.client;
363
364        let uri_str = format!("{}/external-task/{id}/failure", configuration.base_path, id=crate::apis::urlencode(id));
365        let mut req_builder = client.post(uri_str.as_str());
366
367        if let Some(ref user_agent) = configuration.user_agent {
368            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
369        }
370        req_builder = req_builder.json(&external_task_failure_dto);
371
372        // send request
373        let req = req_builder.build()?;
374
375        client.execute(req)?.error_for_status()?;
376        Ok(())
377    }
378
379    fn query_external_tasks(&self, first_result: Option<i32>, max_results: Option<i32>, external_task_query_dto: Option<crate::models::ExternalTaskQueryDto>) -> Result<Vec<crate::models::ExternalTaskDto>, Error> {
380        let configuration: &configuration::Configuration = self.configuration.borrow();
381        let client = &configuration.client;
382
383        let uri_str = format!("{}/external-task", configuration.base_path);
384        let mut req_builder = client.post(uri_str.as_str());
385
386        if let Some(ref s) = first_result {
387            req_builder = req_builder.query(&[("firstResult", &s.to_string())]);
388        }
389        if let Some(ref s) = max_results {
390            req_builder = req_builder.query(&[("maxResults", &s.to_string())]);
391        }
392        if let Some(ref user_agent) = configuration.user_agent {
393            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
394        }
395        req_builder = req_builder.json(&external_task_query_dto);
396
397        // send request
398        let req = req_builder.build()?;
399
400        Ok(client.execute(req)?.error_for_status()?.json()?)
401    }
402
403    fn query_external_tasks_count(&self, external_task_query_dto: Option<crate::models::ExternalTaskQueryDto>) -> Result<crate::models::CountResultDto, Error> {
404        let configuration: &configuration::Configuration = self.configuration.borrow();
405        let client = &configuration.client;
406
407        let uri_str = format!("{}/external-task/count", configuration.base_path);
408        let mut req_builder = client.post(uri_str.as_str());
409
410        if let Some(ref user_agent) = configuration.user_agent {
411            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
412        }
413        req_builder = req_builder.json(&external_task_query_dto);
414
415        // send request
416        let req = req_builder.build()?;
417
418        Ok(client.execute(req)?.error_for_status()?.json()?)
419    }
420
421    fn set_external_task_resource_priority(&self, id: &str, priority_dto: Option<crate::models::PriorityDto>) -> Result<(), Error> {
422        let configuration: &configuration::Configuration = self.configuration.borrow();
423        let client = &configuration.client;
424
425        let uri_str = format!("{}/external-task/{id}/priority", configuration.base_path, id=crate::apis::urlencode(id));
426        let mut req_builder = client.put(uri_str.as_str());
427
428        if let Some(ref user_agent) = configuration.user_agent {
429            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
430        }
431        req_builder = req_builder.json(&priority_dto);
432
433        // send request
434        let req = req_builder.build()?;
435
436        client.execute(req)?.error_for_status()?;
437        Ok(())
438    }
439
440    fn set_external_task_resource_retries(&self, id: &str, retries_dto: Option<crate::models::RetriesDto>) -> Result<(), Error> {
441        let configuration: &configuration::Configuration = self.configuration.borrow();
442        let client = &configuration.client;
443
444        let uri_str = format!("{}/external-task/{id}/retries", configuration.base_path, id=crate::apis::urlencode(id));
445        let mut req_builder = client.put(uri_str.as_str());
446
447        if let Some(ref user_agent) = configuration.user_agent {
448            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
449        }
450        req_builder = req_builder.json(&retries_dto);
451
452        // send request
453        let req = req_builder.build()?;
454
455        client.execute(req)?.error_for_status()?;
456        Ok(())
457    }
458
459    fn set_external_task_retries(&self, set_retries_for_external_tasks_dto: Option<crate::models::SetRetriesForExternalTasksDto>) -> Result<(), Error> {
460        let configuration: &configuration::Configuration = self.configuration.borrow();
461        let client = &configuration.client;
462
463        let uri_str = format!("{}/external-task/retries", configuration.base_path);
464        let mut req_builder = client.put(uri_str.as_str());
465
466        if let Some(ref user_agent) = configuration.user_agent {
467            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
468        }
469        req_builder = req_builder.json(&set_retries_for_external_tasks_dto);
470
471        // send request
472        let req = req_builder.build()?;
473
474        client.execute(req)?.error_for_status()?;
475        Ok(())
476    }
477
478    fn set_external_task_retries_async_operation(&self, set_retries_for_external_tasks_dto: Option<crate::models::SetRetriesForExternalTasksDto>) -> Result<crate::models::BatchDto, Error> {
479        let configuration: &configuration::Configuration = self.configuration.borrow();
480        let client = &configuration.client;
481
482        let uri_str = format!("{}/external-task/retries-async", configuration.base_path);
483        let mut req_builder = client.post(uri_str.as_str());
484
485        if let Some(ref user_agent) = configuration.user_agent {
486            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
487        }
488        req_builder = req_builder.json(&set_retries_for_external_tasks_dto);
489
490        // send request
491        let req = req_builder.build()?;
492
493        Ok(client.execute(req)?.error_for_status()?.json()?)
494    }
495
496    fn unlock(&self, id: &str) -> Result<(), Error> {
497        let configuration: &configuration::Configuration = self.configuration.borrow();
498        let client = &configuration.client;
499
500        let uri_str = format!("{}/external-task/{id}/unlock", configuration.base_path, id=crate::apis::urlencode(id));
501        let mut req_builder = client.post(uri_str.as_str());
502
503        if let Some(ref user_agent) = configuration.user_agent {
504            req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
505        }
506
507        // send request
508        let req = req_builder.build()?;
509
510        client.execute(req)?.error_for_status()?;
511        Ok(())
512    }
513
514}