openapi_github/models/
repository_advisory_update.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.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 RepositoryAdvisoryUpdate {
16    /// A short summary of the advisory.
17    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
18    pub summary: Option<String>,
19    /// A detailed description of what the advisory impacts.
20    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
21    pub description: Option<String>,
22    /// The Common Vulnerabilities and Exposures (CVE) ID.
23    #[serde(rename = "cve_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub cve_id: Option<Option<String>>,
25    /// A product affected by the vulnerability detailed in a repository security advisory.
26    #[serde(rename = "vulnerabilities", skip_serializing_if = "Option::is_none")]
27    pub vulnerabilities: Option<Vec<models::RepositoryAdvisoryCreateVulnerabilitiesInner>>,
28    /// A list of Common Weakness Enumeration (CWE) IDs.
29    #[serde(rename = "cwe_ids", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub cwe_ids: Option<Option<Vec<String>>>,
31    /// A list of users receiving credit for their participation in the security advisory.
32    #[serde(rename = "credits", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33    pub credits: Option<Option<Vec<models::RepositoryAdvisoryCreateCreditsInner>>>,
34    /// The severity of the advisory. You must choose between setting this field or `cvss_vector_string`.
35    #[serde(rename = "severity", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub severity: Option<Option<Severity>>,
37    /// The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`.
38    #[serde(rename = "cvss_vector_string", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
39    pub cvss_vector_string: Option<Option<String>>,
40    /// The state of the advisory.
41    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
42    pub state: Option<State>,
43    /// A list of usernames who have been granted write access to the advisory.
44    #[serde(rename = "collaborating_users", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
45    pub collaborating_users: Option<Option<Vec<String>>>,
46    /// A list of team slugs which have been granted write access to the advisory.
47    #[serde(rename = "collaborating_teams", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
48    pub collaborating_teams: Option<Option<Vec<String>>>,
49}
50
51impl RepositoryAdvisoryUpdate {
52    pub fn new() -> RepositoryAdvisoryUpdate {
53        RepositoryAdvisoryUpdate {
54            summary: None,
55            description: None,
56            cve_id: None,
57            vulnerabilities: None,
58            cwe_ids: None,
59            credits: None,
60            severity: None,
61            cvss_vector_string: None,
62            state: None,
63            collaborating_users: None,
64            collaborating_teams: None,
65        }
66    }
67}
68/// The severity of the advisory. You must choose between setting this field or `cvss_vector_string`.
69#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
70pub enum Severity {
71    #[serde(rename = "critical")]
72    Critical,
73    #[serde(rename = "high")]
74    High,
75    #[serde(rename = "medium")]
76    Medium,
77    #[serde(rename = "low")]
78    Low,
79}
80
81impl Default for Severity {
82    fn default() -> Severity {
83        Self::Critical
84    }
85}
86/// The state of the advisory.
87#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
88pub enum State {
89    #[serde(rename = "published")]
90    Published,
91    #[serde(rename = "closed")]
92    Closed,
93    #[serde(rename = "draft")]
94    Draft,
95}
96
97impl Default for State {
98    fn default() -> State {
99        Self::Published
100    }
101}
102