camunda_client/models/fetch_external_tasks_dto.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
11
12
13
14#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
15pub struct FetchExternalTasksDto {
16 /// **Mandatory.** The id of the worker on which behalf tasks are fetched. The returned tasks are locked for that worker and can only be completed when providing the same worker id.
17 #[serde(rename = "workerId")]
18 pub worker_id: String,
19 /// **Mandatory.** The maximum number of tasks to return.
20 #[serde(rename = "maxTasks")]
21 pub max_tasks: Option<i32>,
22 /// A `boolean` value, which indicates whether the task should be fetched based on its priority or arbitrarily.
23 #[serde(rename = "usePriority", skip_serializing_if = "Option::is_none")]
24 pub use_priority: Option<bool>,
25 /// The [Long Polling](https://docs.camunda.org/manual/7.13/user-guide/process-engine/external-tasks/#long-polling-to-fetch-and-lock-external-tasks) timeout in milliseconds. **Note:** The value cannot be set larger than 1.800.000 milliseconds (corresponds to 30 minutes).
26 #[serde(rename = "asyncResponseTimeout", skip_serializing_if = "Option::is_none")]
27 pub async_response_timeout: Option<i64>,
28 /// A JSON array of topic objects for which external tasks should be fetched. The returned tasks may be arbitrarily distributed among these topics. Each topic object has the following properties:
29 #[serde(rename = "topics", skip_serializing_if = "Option::is_none")]
30 pub topics: Option<Vec<crate::models::FetchExternalTaskTopicDto>>,
31}
32
33impl FetchExternalTasksDto {
34 pub fn new(worker_id: String, max_tasks: Option<i32>) -> FetchExternalTasksDto {
35 FetchExternalTasksDto {
36 worker_id,
37 max_tasks,
38 use_priority: None,
39 async_response_timeout: None,
40 topics: None,
41 }
42 }
43}
44
45