harbor_api/models/
stats.rs

1/*
2 * Harbor API
3 *
4 * These APIs provide services for manipulating Harbor project.
5 *
6 * The version of the OpenAPI document: 2.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Stats : Stats provides the overall progress of the scan all process.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Stats {
17    /// The total number of scan processes triggered by the scan all action
18    #[serde(rename = "total", skip_serializing_if = "Option::is_none")]
19    pub total: Option<i32>,
20    /// The number of the finished scan processes triggered by the scan all action
21    #[serde(rename = "completed", skip_serializing_if = "Option::is_none")]
22    pub completed: Option<i32>,
23    /// The metrics data for the each status
24    #[serde(rename = "metrics", skip_serializing_if = "Option::is_none")]
25    pub metrics: Option<std::collections::HashMap<String, i32>>,
26    /// A flag indicating job status of scan all.
27    #[serde(rename = "ongoing", skip_serializing_if = "Option::is_none")]
28    pub ongoing: Option<bool>,
29    /// The trigger of the scan all job.
30    #[serde(rename = "trigger", skip_serializing_if = "Option::is_none")]
31    pub trigger: Option<Trigger>,
32}
33
34impl Stats {
35    /// Stats provides the overall progress of the scan all process.
36    pub fn new() -> Stats {
37        Stats {
38            total: None,
39            completed: None,
40            metrics: None,
41            ongoing: None,
42            trigger: None,
43        }
44    }
45}
46/// The trigger of the scan all job.
47#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
48pub enum Trigger {
49    #[serde(rename = "Manual")]
50    Manual,
51    #[serde(rename = "Schedule")]
52    Schedule,
53    #[serde(rename = "Event")]
54    Event,
55}
56
57impl Default for Trigger {
58    fn default() -> Trigger {
59        Self::Manual
60    }
61}
62