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