openapi_github/models/
private_vulnerability_report_create.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 PrivateVulnerabilityReportCreate {
16    /// A short summary of the advisory.
17    #[serde(rename = "summary")]
18    pub summary: String,
19    /// A detailed description of what the advisory impacts.
20    #[serde(rename = "description")]
21    pub description: String,
22    /// An array of products affected by the vulnerability detailed in a repository security advisory.
23    #[serde(rename = "vulnerabilities", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub vulnerabilities: Option<Option<Vec<models::RepositoryAdvisoryCreateVulnerabilitiesInner>>>,
25    /// A list of Common Weakness Enumeration (CWE) IDs.
26    #[serde(rename = "cwe_ids", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
27    pub cwe_ids: Option<Option<Vec<String>>>,
28    /// The severity of the advisory. You must choose between setting this field or `cvss_vector_string`.
29    #[serde(rename = "severity", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub severity: Option<Option<Severity>>,
31    /// The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`.
32    #[serde(rename = "cvss_vector_string", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33    pub cvss_vector_string: Option<Option<String>>,
34    /// Whether to create a temporary private fork of the repository to collaborate on a fix.
35    #[serde(rename = "start_private_fork", skip_serializing_if = "Option::is_none")]
36    pub start_private_fork: Option<bool>,
37}
38
39impl PrivateVulnerabilityReportCreate {
40    pub fn new(summary: String, description: String) -> PrivateVulnerabilityReportCreate {
41        PrivateVulnerabilityReportCreate {
42            summary,
43            description,
44            vulnerabilities: None,
45            cwe_ids: None,
46            severity: None,
47            cvss_vector_string: None,
48            start_private_fork: None,
49        }
50    }
51}
52/// The severity of the advisory. You must choose between setting this field or `cvss_vector_string`.
53#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
54pub enum Severity {
55    #[serde(rename = "critical")]
56    Critical,
57    #[serde(rename = "high")]
58    High,
59    #[serde(rename = "medium")]
60    Medium,
61    #[serde(rename = "low")]
62    Low,
63}
64
65impl Default for Severity {
66    fn default() -> Severity {
67        Self::Critical
68    }
69}
70