harbor_api/models/
robot.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Robot {
16    /// The ID of the robot
17    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
18    pub id: Option<i64>,
19    /// The name of the robot
20    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
21    pub name: Option<String>,
22    /// The description of the robot
23    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
24    pub description: Option<String>,
25    /// The secret of the robot
26    #[serde(rename = "secret", skip_serializing_if = "Option::is_none")]
27    pub secret: Option<String>,
28    /// The level of the robot, project or system
29    #[serde(rename = "level", skip_serializing_if = "Option::is_none")]
30    pub level: Option<String>,
31    /// The duration of the robot in days, duration must be either -1(Never) or a positive integer
32    #[serde(rename = "duration", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33    pub duration: Option<Option<i64>>,
34    /// The editable status of the robot
35    #[serde(rename = "editable", skip_serializing_if = "Option::is_none")]
36    pub editable: Option<bool>,
37    /// The disable status of the robot
38    #[serde(rename = "disable", skip_serializing_if = "Option::is_none")]
39    pub disable: Option<bool>,
40    /// The expiration date of the robot
41    #[serde(rename = "expires_at", skip_serializing_if = "Option::is_none")]
42    pub expires_at: Option<i64>,
43    #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")]
44    pub permissions: Option<Vec<models::RobotPermission>>,
45    /// The type of the robot creator, like local(harbor_user) or robot.
46    #[serde(rename = "creator_type", skip_serializing_if = "Option::is_none")]
47    pub creator_type: Option<String>,
48    /// The reference of the robot creator, like the id of harbor user.
49    #[serde(rename = "creator_ref", skip_serializing_if = "Option::is_none")]
50    pub creator_ref: Option<i32>,
51    /// The creation time of the robot.
52    #[serde(rename = "creation_time", skip_serializing_if = "Option::is_none")]
53    pub creation_time: Option<String>,
54    /// The update time of the robot.
55    #[serde(rename = "update_time", skip_serializing_if = "Option::is_none")]
56    pub update_time: Option<String>,
57}
58
59impl Robot {
60    pub fn new() -> Robot {
61        Robot {
62            id: None,
63            name: None,
64            description: None,
65            secret: None,
66            level: None,
67            duration: None,
68            editable: None,
69            disable: None,
70            expires_at: None,
71            permissions: None,
72            creator_type: None,
73            creator_ref: None,
74            creation_time: None,
75            update_time: None,
76        }
77    }
78}
79