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};

/// DependabotAlertSecurityVulnerability : Details pertaining to one vulnerable version range for the advisory.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DependabotAlertSecurityVulnerability {
    #[serde(rename = "package")]
    pub package: Box<models::DependabotAlertPackage>,
    /// The severity of the vulnerability.
    #[serde(rename = "severity")]
    pub severity: Severity,
    /// Conditions that identify vulnerable versions of this vulnerability's package.
    #[serde(rename = "vulnerable_version_range")]
    pub vulnerable_version_range: String,
    #[serde(rename = "first_patched_version", deserialize_with = "Option::deserialize")]
    pub first_patched_version: Option<Box<models::DependabotAlertSecurityVulnerabilityFirstPatchedVersion>>,
}

impl DependabotAlertSecurityVulnerability {
    /// Details pertaining to one vulnerable version range for the advisory.
    pub fn new(package: models::DependabotAlertPackage, severity: Severity, vulnerable_version_range: String, first_patched_version: Option<models::DependabotAlertSecurityVulnerabilityFirstPatchedVersion>) -> DependabotAlertSecurityVulnerability {
        DependabotAlertSecurityVulnerability {
            package: Box::new(package),
            severity,
            vulnerable_version_range,
            first_patched_version: first_patched_version.map(Box::new),
        }
    }
}
/// The severity of the vulnerability.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Severity {
    #[serde(rename = "low")]
    Low,
    #[serde(rename = "medium")]
    Medium,
    #[serde(rename = "high")]
    High,
    #[serde(rename = "critical")]
    Critical,
}

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