harbor_api/models/
project.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 Project {
16    /// Project ID
17    #[serde(rename = "project_id", skip_serializing_if = "Option::is_none")]
18    pub project_id: Option<i32>,
19    /// The owner ID of the project always means the creator of the project.
20    #[serde(rename = "owner_id", skip_serializing_if = "Option::is_none")]
21    pub owner_id: Option<i32>,
22    /// The name of the project.
23    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
24    pub name: Option<String>,
25    /// The ID of referenced registry when the project is a proxy cache project.
26    #[serde(rename = "registry_id", skip_serializing_if = "Option::is_none")]
27    pub registry_id: Option<i64>,
28    /// The creation time of the project.
29    #[serde(rename = "creation_time", skip_serializing_if = "Option::is_none")]
30    pub creation_time: Option<String>,
31    /// The update time of the project.
32    #[serde(rename = "update_time", skip_serializing_if = "Option::is_none")]
33    pub update_time: Option<String>,
34    /// A deletion mark of the project.
35    #[serde(rename = "deleted", skip_serializing_if = "Option::is_none")]
36    pub deleted: Option<bool>,
37    /// The owner name of the project.
38    #[serde(rename = "owner_name", skip_serializing_if = "Option::is_none")]
39    pub owner_name: Option<String>,
40    /// Correspond to the UI about whether the project's publicity is  updatable (for UI)
41    #[serde(rename = "togglable", skip_serializing_if = "Option::is_none")]
42    pub togglable: Option<bool>,
43    /// The role ID with highest permission of the current user who triggered the API (for UI).  This attribute is deprecated and will be removed in future versions.
44    #[serde(rename = "current_user_role_id", skip_serializing_if = "Option::is_none")]
45    pub current_user_role_id: Option<i32>,
46    /// The list of role ID of the current user who triggered the API (for UI)
47    #[serde(rename = "current_user_role_ids", skip_serializing_if = "Option::is_none")]
48    pub current_user_role_ids: Option<Vec<i32>>,
49    /// The number of the repositories under this project.
50    #[serde(rename = "repo_count", skip_serializing_if = "Option::is_none")]
51    pub repo_count: Option<i32>,
52    #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
53    pub metadata: Option<Box<models::ProjectMetadata>>,
54    #[serde(rename = "cve_allowlist", skip_serializing_if = "Option::is_none")]
55    pub cve_allowlist: Option<Box<models::CveAllowlist>>,
56}
57
58impl Project {
59    pub fn new() -> Project {
60        Project {
61            project_id: None,
62            owner_id: None,
63            name: None,
64            registry_id: None,
65            creation_time: None,
66            update_time: None,
67            deleted: None,
68            owner_name: None,
69            togglable: None,
70            current_user_role_id: None,
71            current_user_role_ids: None,
72            repo_count: None,
73            metadata: None,
74            cve_allowlist: None,
75        }
76    }
77}
78