lattice_sdk/api/types/
task.rs

1pub use crate::prelude::*;
2
3/// A Task is something an agent can be asked to do.
4#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
5pub struct Task {
6    /// Version of this Task.
7    #[serde(skip_serializing_if = "Option::is_none")]
8    pub version: Option<TaskVersion>,
9    /// DEPRECATED: Human readable display name for this Task, should be short (<100 chars).
10    #[serde(rename = "displayName")]
11    #[serde(skip_serializing_if = "Option::is_none")]
12    pub display_name: Option<String>,
13    /// Full Task parameterization.
14    #[serde(skip_serializing_if = "Option::is_none")]
15    pub specification: Option<GoogleProtobufAny>,
16    /// Records who created this Task. This field will not change after the Task has been created.
17    #[serde(rename = "createdBy")]
18    #[serde(skip_serializing_if = "Option::is_none")]
19    pub created_by: Option<Principal>,
20    /// Records who updated this Task last.
21    #[serde(rename = "lastUpdatedBy")]
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub last_updated_by: Option<Principal>,
24    /// Records the time of last update.
25    #[serde(rename = "lastUpdateTime")]
26    #[serde(skip_serializing_if = "Option::is_none")]
27    pub last_update_time: Option<DateTime<Utc>>,
28    /// The status of this Task.
29    #[serde(skip_serializing_if = "Option::is_none")]
30    pub status: Option<TaskStatus>,
31    /// If the Task has been scheduled to execute, what time it should execute at.
32    #[serde(rename = "scheduledTime")]
33    #[serde(skip_serializing_if = "Option::is_none")]
34    pub scheduled_time: Option<DateTime<Utc>>,
35    /// Any related Tasks associated with this, typically includes an assignee for this Task and/or a parent.
36    #[serde(skip_serializing_if = "Option::is_none")]
37    pub relations: Option<Relations>,
38    /// Longer, free form human readable description of this Task
39    #[serde(skip_serializing_if = "Option::is_none")]
40    pub description: Option<String>,
41    /// If set, execution of this Task is managed elsewhere, not by Task Manager.
42    /// In other words, Task manager will not attempt to update the assigned agent with execution instructions.
43    #[serde(rename = "isExecutedElsewhere")]
44    #[serde(skip_serializing_if = "Option::is_none")]
45    pub is_executed_elsewhere: Option<bool>,
46    /// Time of Task creation.
47    #[serde(rename = "createTime")]
48    #[serde(skip_serializing_if = "Option::is_none")]
49    pub create_time: Option<DateTime<Utc>>,
50    /// If populated, designates this to be a replicated Task.
51    #[serde(skip_serializing_if = "Option::is_none")]
52    pub replication: Option<Replication>,
53    /// If populated, indicates an initial set of entities that can be used to execute an entity aware task
54    /// For example, an entity Objective, an entity Keep In Zone, etc.
55    /// These will not be updated during execution. If a taskable agent needs continuous updates on the entities from the
56    /// COP, can call entity-manager, or use an AlternateId escape hatch.
57    #[serde(rename = "initialEntities")]
58    #[serde(skip_serializing_if = "Option::is_none")]
59    pub initial_entities: Option<Vec<TaskEntity>>,
60    /// The networked owner of this Task. It is used to ensure that linear writes occur on the node responsible
61    /// for replication of task data to other nodes running Task Manager.
62    #[serde(skip_serializing_if = "Option::is_none")]
63    pub owner: Option<Owner>,
64}