Skip to main content

swf_core/models/task/
wait_task.rs

1use serde::{Deserialize, Serialize};
2
3use super::TaskDefinitionFields;
4use crate::models::duration::OneOfDurationOrIso8601Expression;
5
6/// Represents the definition of a task used to wait a certain amount of time
7#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
8pub struct WaitTaskDefinition {
9    /// Gets/sets the amount of time to wait before resuming workflow
10    #[serde(rename = "wait")]
11    pub wait: OneOfDurationOrIso8601Expression,
12
13    /// Gets/sets the task's common fields
14    #[serde(flatten)]
15    pub common: TaskDefinitionFields,
16}
17impl WaitTaskDefinition {
18    /// Initializes a new WaitTaskDefinition
19    pub fn new(wait: OneOfDurationOrIso8601Expression) -> Self {
20        Self {
21            wait,
22            common: TaskDefinitionFields::new(),
23        }
24    }
25}