Skip to main content

swf_core/models/task/
do_task.rs

1use serde::{Deserialize, Serialize};
2
3use super::{Map, TaskDefinition, TaskDefinitionFields};
4
5/// Represents the configuration of a task that is composed of multiple subtasks to run sequentially
6#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
7pub struct DoTaskDefinition {
8    /// Gets/sets a name/definition mapping of the subtasks to perform sequentially
9    #[serde(rename = "do")]
10    pub do_: Map<String, TaskDefinition>,
11
12    /// Gets/sets the task's common fields
13    #[serde(flatten)]
14    pub common: TaskDefinitionFields,
15}
16impl DoTaskDefinition {
17    /// Initializes a new DoTaskDefinition
18    pub fn new(do_: Map<String, TaskDefinition>) -> Self {
19        Self {
20            do_,
21            common: TaskDefinitionFields::new(),
22        }
23    }
24}