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

/// RepositoryAdvisoryVulnerability : A product affected by the vulnerability detailed in a repository security advisory.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RepositoryAdvisoryVulnerability {
    #[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(s) that resolve the vulnerability.
    #[serde(rename = "patched_versions", deserialize_with = "Option::deserialize")]
    pub patched_versions: Option<String>,
    /// The functions in the package that are affected.
    #[serde(rename = "vulnerable_functions", deserialize_with = "Option::deserialize")]
    pub vulnerable_functions: Option<Vec<String>>,
}

impl RepositoryAdvisoryVulnerability {
    /// A product affected by the vulnerability detailed in a repository security advisory.
    pub fn new(package: Option<models::VulnerabilityPackage>, vulnerable_version_range: Option<String>, patched_versions: Option<String>, vulnerable_functions: Option<Vec<String>>) -> RepositoryAdvisoryVulnerability {
        RepositoryAdvisoryVulnerability {
            package: package.map(Box::new),
            vulnerable_version_range,
            patched_versions,
            vulnerable_functions,
        }
    }
}