geoengine_api_client/models/
task_status_with_id.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct TaskStatusWithId {
16 #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
17 pub description: Option<String>,
18 #[serde(rename = "estimatedTimeRemaining")]
19 pub estimated_time_remaining: String,
20 #[serde(rename = "info", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21 pub info: Option<Option<serde_json::Value>>,
22 #[serde(rename = "pctComplete")]
23 pub pct_complete: String,
24 #[serde(rename = "status")]
25 pub status: Status,
26 #[serde(rename = "taskType")]
27 pub task_type: String,
28 #[serde(rename = "timeStarted")]
29 pub time_started: String,
30 #[serde(rename = "timeTotal")]
31 pub time_total: String,
32 #[serde(rename = "cleanUp", deserialize_with = "Option::deserialize")]
33 pub clean_up: Option<serde_json::Value>,
34 #[serde(rename = "error", deserialize_with = "Option::deserialize")]
35 pub error: Option<serde_json::Value>,
36 #[serde(rename = "taskId")]
37 pub task_id: uuid::Uuid,
38}
39
40impl TaskStatusWithId {
41 pub fn new(estimated_time_remaining: String, pct_complete: String, status: Status, task_type: String, time_started: String, time_total: String, clean_up: Option<serde_json::Value>, error: Option<serde_json::Value>, task_id: uuid::Uuid) -> TaskStatusWithId {
42 TaskStatusWithId {
43 description: None,
44 estimated_time_remaining,
45 info: None,
46 pct_complete,
47 status,
48 task_type,
49 time_started,
50 time_total,
51 clean_up,
52 error,
53 task_id,
54 }
55 }
56}
57#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
59pub enum Status {
60 #[serde(rename = "failed")]
61 Failed,
62}
63
64impl Default for Status {
65 fn default() -> Status {
66 Self::Failed
67 }
68}
69