jira_api_v2/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
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// TaskProgressBeanObject : Details about a task.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TaskProgressBeanObject {
17    /// The URL of the task.
18    #[serde(rename = "self")]
19    pub param_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", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub result: Option<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(param_self: String, id: String, status: Status, submitted_by: i64, progress: i64, elapsed_runtime: i64, submitted: i64, last_update: i64) -> TaskProgressBeanObject {
61        TaskProgressBeanObject {
62            param_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/// The status of the task.
79#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
80pub enum Status {
81    #[serde(rename = "ENQUEUED")]
82    Enqueued,
83    #[serde(rename = "RUNNING")]
84    Running,
85    #[serde(rename = "COMPLETE")]
86    Complete,
87    #[serde(rename = "FAILED")]
88    Failed,
89    #[serde(rename = "CANCEL_REQUESTED")]
90    CancelRequested,
91    #[serde(rename = "CANCELLED")]
92    Cancelled,
93    #[serde(rename = "DEAD")]
94    Dead,
95}
96
97impl Default for Status {
98    fn default() -> Status {
99        Self::Enqueued
100    }
101}
102