hi_jira2/models/
task_progress_bean_object.rs

1/*
2 * The Jira Cloud platform REST API
3 *
4 * Jira Cloud platform REST API documentation
5 *
6 * The version of the OpenAPI document: 1001.0.0-SNAPSHOT
7 * Contact: ecosystem@atlassian.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// TaskProgressBeanObject : Details about a task.
12
13
14
15#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
16pub struct TaskProgressBeanObject {
17    /// The URL of the task.
18    #[serde(rename = "self")]
19    pub _self: String,
20    /// The ID of the task.
21    #[serde(rename = "id")]
22    pub id: String,
23    /// The description of the task.
24    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
25    pub description: Option<String>,
26    /// The status of the task.
27    #[serde(rename = "status")]
28    pub status: Status,
29    /// Information about the progress of the task.
30    #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
31    pub message: Option<String>,
32    /// The result of the task execution.
33    #[serde(rename = "result", skip_serializing_if = "Option::is_none")]
34    pub result: Option<serde_json::Value>,
35    /// The ID of the user who submitted the task.
36    #[serde(rename = "submittedBy")]
37    pub submitted_by: i64,
38    /// The progress of the task, as a percentage complete.
39    #[serde(rename = "progress")]
40    pub progress: i64,
41    /// The execution time of the task, in milliseconds.
42    #[serde(rename = "elapsedRuntime")]
43    pub elapsed_runtime: i64,
44    /// A timestamp recording when the task was submitted.
45    #[serde(rename = "submitted")]
46    pub submitted: i64,
47    /// A timestamp recording when the task was started.
48    #[serde(rename = "started", skip_serializing_if = "Option::is_none")]
49    pub started: Option<i64>,
50    /// A timestamp recording when the task was finished.
51    #[serde(rename = "finished", skip_serializing_if = "Option::is_none")]
52    pub finished: Option<i64>,
53    /// A timestamp recording when the task progress was last updated.
54    #[serde(rename = "lastUpdate")]
55    pub last_update: i64,
56}
57
58impl TaskProgressBeanObject {
59    /// Details about a task.
60    pub fn new(_self: String, id: String, status: Status, submitted_by: i64, progress: i64, elapsed_runtime: i64, submitted: i64, last_update: i64) -> TaskProgressBeanObject {
61        TaskProgressBeanObject {
62            _self,
63            id,
64            description: None,
65            status,
66            message: None,
67            result: None,
68            submitted_by,
69            progress,
70            elapsed_runtime,
71            submitted,
72            started: None,
73            finished: None,
74            last_update,
75        }
76    }
77}
78
79/// The status of the task.
80#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
81pub enum Status {
82    #[serde(rename = "ENQUEUED")]
83    ENQUEUED,
84    #[serde(rename = "RUNNING")]
85    RUNNING,
86    #[serde(rename = "COMPLETE")]
87    COMPLETE,
88    #[serde(rename = "FAILED")]
89    FAILED,
90    #[serde(rename = "CANCEL_REQUESTED")]
91    CANCELREQUESTED,
92    #[serde(rename = "CANCELLED")]
93    CANCELLED,
94    #[serde(rename = "DEAD")]
95    DEAD,
96}
97
98impl Default for Status {
99    fn default() -> Status {
100        Self::ENQUEUED
101    }
102}
103