harbor_api/models/
worker.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/// Worker : worker in the pool
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Worker {
17    /// the id of the worker
18    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
19    pub id: Option<String>,
20    /// the id of the worker pool
21    #[serde(rename = "pool_id", skip_serializing_if = "Option::is_none")]
22    pub pool_id: Option<String>,
23    /// the name of the running job in the worker
24    #[serde(rename = "job_name", skip_serializing_if = "Option::is_none")]
25    pub job_name: Option<String>,
26    /// the id of the running job in the worker
27    #[serde(rename = "job_id", skip_serializing_if = "Option::is_none")]
28    pub job_id: Option<String>,
29    /// The start time of the worker
30    #[serde(rename = "start_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub start_at: Option<Option<String>>,
32    /// the checkin of the running job in the worker
33    #[serde(rename = "check_in", skip_serializing_if = "Option::is_none")]
34    pub check_in: Option<String>,
35    /// The checkin time of the worker
36    #[serde(rename = "checkin_at", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
37    pub checkin_at: Option<Option<String>>,
38}
39
40impl Worker {
41    /// worker in the pool
42    pub fn new() -> Worker {
43        Worker {
44            id: None,
45            pool_id: None,
46            job_name: None,
47            job_id: None,
48            start_at: None,
49            check_in: None,
50            checkin_at: None,
51        }
52    }
53}
54