openapi-github 0.1.0

OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
Documentation
/*
 * GitHub's official OpenAPI spec + Octokit extension
 *
 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
 *
 * The version of the OpenAPI document: 16.6.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PrivateVulnerabilityReportCreate {
    /// A short summary of the advisory.
    #[serde(rename = "summary")]
    pub summary: String,
    /// A detailed description of what the advisory impacts.
    #[serde(rename = "description")]
    pub description: String,
    /// An array of products affected by the vulnerability detailed in a repository security advisory.
    #[serde(rename = "vulnerabilities", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub vulnerabilities: Option<Option<Vec<models::RepositoryAdvisoryCreateVulnerabilitiesInner>>>,
    /// A list of Common Weakness Enumeration (CWE) IDs.
    #[serde(rename = "cwe_ids", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub cwe_ids: Option<Option<Vec<String>>>,
    /// The severity of the advisory. You must choose between setting this field or `cvss_vector_string`.
    #[serde(rename = "severity", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub severity: Option<Option<Severity>>,
    /// The CVSS vector that calculates the severity of the advisory. You must choose between setting this field or `severity`.
    #[serde(rename = "cvss_vector_string", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub cvss_vector_string: Option<Option<String>>,
    /// Whether to create a temporary private fork of the repository to collaborate on a fix.
    #[serde(rename = "start_private_fork", skip_serializing_if = "Option::is_none")]
    pub start_private_fork: Option<bool>,
}

impl PrivateVulnerabilityReportCreate {
    pub fn new(summary: String, description: String) -> PrivateVulnerabilityReportCreate {
        PrivateVulnerabilityReportCreate {
            summary,
            description,
            vulnerabilities: None,
            cwe_ids: None,
            severity: None,
            cvss_vector_string: None,
            start_private_fork: None,
        }
    }
}
/// The severity of the advisory. You must choose between setting this field or `cvss_vector_string`.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Severity {
    #[serde(rename = "critical")]
    Critical,
    #[serde(rename = "high")]
    High,
    #[serde(rename = "medium")]
    Medium,
    #[serde(rename = "low")]
    Low,
}

impl Default for Severity {
    fn default() -> Severity {
        Self::Critical
    }
}