openapi_github/models/
repository_advisory_vulnerability.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/// RepositoryAdvisoryVulnerability : A product affected by the vulnerability detailed in a repository security advisory.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct RepositoryAdvisoryVulnerability {
17    #[serde(rename = "package", deserialize_with = "Option::deserialize")]
18    pub package: Option<Box<models::VulnerabilityPackage>>,
19    /// The range of the package versions affected by the vulnerability.
20    #[serde(rename = "vulnerable_version_range", deserialize_with = "Option::deserialize")]
21    pub vulnerable_version_range: Option<String>,
22    /// The package version(s) that resolve the vulnerability.
23    #[serde(rename = "patched_versions", deserialize_with = "Option::deserialize")]
24    pub patched_versions: Option<String>,
25    /// The functions in the package that are affected.
26    #[serde(rename = "vulnerable_functions", deserialize_with = "Option::deserialize")]
27    pub vulnerable_functions: Option<Vec<String>>,
28}
29
30impl RepositoryAdvisoryVulnerability {
31    /// A product affected by the vulnerability detailed in a repository security advisory.
32    pub fn new(package: Option<models::VulnerabilityPackage>, vulnerable_version_range: Option<String>, patched_versions: Option<String>, vulnerable_functions: Option<Vec<String>>) -> RepositoryAdvisoryVulnerability {
33        RepositoryAdvisoryVulnerability {
34            package: package.map(Box::new),
35            vulnerable_version_range,
36            patched_versions,
37            vulnerable_functions,
38        }
39    }
40}
41