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

/// Vulnerability : A vulnerability describing the product and its affected versions within a GitHub Security Advisory.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Vulnerability {
    #[serde(rename = "package", deserialize_with = "Option::deserialize")]
    pub package: Option<Box<models::VulnerabilityPackage>>,
    /// The range of the package versions affected by the vulnerability.
    #[serde(rename = "vulnerable_version_range", deserialize_with = "Option::deserialize")]
    pub vulnerable_version_range: Option<String>,
    /// The package version that resolves the vulnerability.
    #[serde(rename = "first_patched_version", deserialize_with = "Option::deserialize")]
    pub first_patched_version: Option<String>,
    /// The functions in the package that are affected by the vulnerability.
    #[serde(rename = "vulnerable_functions", deserialize_with = "Option::deserialize")]
    pub vulnerable_functions: Option<Vec<String>>,
}

impl Vulnerability {
    /// A vulnerability describing the product and its affected versions within a GitHub Security Advisory.
    pub fn new(package: Option<models::VulnerabilityPackage>, vulnerable_version_range: Option<String>, first_patched_version: Option<String>, vulnerable_functions: Option<Vec<String>>) -> Vulnerability {
        Vulnerability {
            package: package.map(Box::new),
            vulnerable_version_range,
            first_patched_version,
            vulnerable_functions,
        }
    }
}