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 RepositoryAdvisoryUpdate {
    /// A short summary of the advisory.
    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
    pub summary: Option<String>,
    /// A detailed description of what the advisory impacts.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// The Common Vulnerabilities and Exposures (CVE) ID.
    #[serde(rename = "cve_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub cve_id: Option<Option<String>>,
    /// A product affected by the vulnerability detailed in a repository security advisory.
    #[serde(rename = "vulnerabilities", skip_serializing_if = "Option::is_none")]
    pub vulnerabilities: 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>>>,
    /// A list of users receiving credit for their participation in the security advisory.
    #[serde(rename = "credits", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub credits: Option<Option<Vec<models::RepositoryAdvisoryCreateCreditsInner>>>,
    /// 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>>,
    /// The state of the advisory.
    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
    pub state: Option<State>,
    /// A list of usernames who have been granted write access to the advisory.
    #[serde(rename = "collaborating_users", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub collaborating_users: Option<Option<Vec<String>>>,
    /// A list of team slugs which have been granted write access to the advisory.
    #[serde(rename = "collaborating_teams", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub collaborating_teams: Option<Option<Vec<String>>>,
}

impl RepositoryAdvisoryUpdate {
    pub fn new() -> RepositoryAdvisoryUpdate {
        RepositoryAdvisoryUpdate {
            summary: None,
            description: None,
            cve_id: None,
            vulnerabilities: None,
            cwe_ids: None,
            credits: None,
            severity: None,
            cvss_vector_string: None,
            state: None,
            collaborating_users: None,
            collaborating_teams: 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
    }
}
/// The state of the advisory.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum State {
    #[serde(rename = "published")]
    Published,
    #[serde(rename = "closed")]
    Closed,
    #[serde(rename = "draft")]
    Draft,
}

impl Default for State {
    fn default() -> State {
        Self::Published
    }
}