harbor-api 2.0.0

These APIs provide services for manipulating Harbor project.
Documentation
/*
 * Harbor API
 *
 * These APIs provide services for manipulating Harbor project.
 *
 * The version of the OpenAPI document: 2.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Robot {
    /// The ID of the robot
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<i64>,
    /// The name of the robot
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// The description of the robot
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// The secret of the robot
    #[serde(rename = "secret", skip_serializing_if = "Option::is_none")]
    pub secret: Option<String>,
    /// The level of the robot, project or system
    #[serde(rename = "level", skip_serializing_if = "Option::is_none")]
    pub level: Option<String>,
    /// The duration of the robot in days, duration must be either -1(Never) or a positive integer
    #[serde(rename = "duration", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub duration: Option<Option<i64>>,
    /// The editable status of the robot
    #[serde(rename = "editable", skip_serializing_if = "Option::is_none")]
    pub editable: Option<bool>,
    /// The disable status of the robot
    #[serde(rename = "disable", skip_serializing_if = "Option::is_none")]
    pub disable: Option<bool>,
    /// The expiration date of the robot
    #[serde(rename = "expires_at", skip_serializing_if = "Option::is_none")]
    pub expires_at: Option<i64>,
    #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")]
    pub permissions: Option<Vec<models::RobotPermission>>,
    /// The type of the robot creator, like local(harbor_user) or robot.
    #[serde(rename = "creator_type", skip_serializing_if = "Option::is_none")]
    pub creator_type: Option<String>,
    /// The reference of the robot creator, like the id of harbor user.
    #[serde(rename = "creator_ref", skip_serializing_if = "Option::is_none")]
    pub creator_ref: Option<i32>,
    /// The creation time of the robot.
    #[serde(rename = "creation_time", skip_serializing_if = "Option::is_none")]
    pub creation_time: Option<String>,
    /// The update time of the robot.
    #[serde(rename = "update_time", skip_serializing_if = "Option::is_none")]
    pub update_time: Option<String>,
}

impl Robot {
    pub fn new() -> Robot {
        Robot {
            id: None,
            name: None,
            description: None,
            secret: None,
            level: None,
            duration: None,
            editable: None,
            disable: None,
            expires_at: None,
            permissions: None,
            creator_type: None,
            creator_ref: None,
            creation_time: None,
            update_time: None,
        }
    }
}