harbor_api/models/
project_metadata.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 ProjectMetadata {
16    /// The public status of the project. The valid values are \"true\", \"false\".
17    #[serde(rename = "public", skip_serializing_if = "Option::is_none")]
18    pub public: Option<String>,
19    /// Whether content trust is enabled or not. If it is enabled, user can't pull unsigned images from this project. The valid values are \"true\", \"false\".
20    #[serde(rename = "enable_content_trust", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub enable_content_trust: Option<Option<String>>,
22    /// Whether cosign content trust is enabled or not. If it is enabled, user can't pull images without cosign signature from this project. The valid values are \"true\", \"false\".
23    #[serde(rename = "enable_content_trust_cosign", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub enable_content_trust_cosign: Option<Option<String>>,
25    /// Whether prevent the vulnerable images from running. The valid values are \"true\", \"false\".
26    #[serde(rename = "prevent_vul", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
27    pub prevent_vul: Option<Option<String>>,
28    /// If the vulnerability is high than severity defined here, the images can't be pulled. The valid values are \"none\", \"low\", \"medium\", \"high\", \"critical\".
29    #[serde(rename = "severity", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub severity: Option<Option<String>>,
31    /// Whether scan images automatically when pushing. The valid values are \"true\", \"false\".
32    #[serde(rename = "auto_scan", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33    pub auto_scan: Option<Option<String>>,
34    /// Whether generating SBOM automatically when pushing a subject artifact. The valid values are \"true\", \"false\".
35    #[serde(rename = "auto_sbom_generation", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub auto_sbom_generation: Option<Option<String>>,
37    /// Whether this project reuse the system level CVE allowlist as the allowlist of its own.  The valid values are \"true\", \"false\". If it is set to \"true\" the actual allowlist associate with this project, if any, will be ignored.
38    #[serde(rename = "reuse_sys_cve_allowlist", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
39    pub reuse_sys_cve_allowlist: Option<Option<String>>,
40    /// The ID of the tag retention policy for the project
41    #[serde(rename = "retention_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
42    pub retention_id: Option<Option<String>>,
43    /// The bandwidth limit of proxy cache, in Kbps (kilobits per second). It limits the communication between Harbor and the upstream registry, not the client and the Harbor.
44    #[serde(rename = "proxy_speed_kb", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
45    pub proxy_speed_kb: Option<Option<String>>,
46}
47
48impl ProjectMetadata {
49    pub fn new() -> ProjectMetadata {
50        ProjectMetadata {
51            public: None,
52            enable_content_trust: None,
53            enable_content_trust_cosign: None,
54            prevent_vul: None,
55            severity: None,
56            auto_scan: None,
57            auto_sbom_generation: None,
58            reuse_sys_cve_allowlist: None,
59            retention_id: None,
60            proxy_speed_kb: None,
61        }
62    }
63}
64