openapi_github/models/
code_scanning_alert_rule_summary.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CodeScanningAlertRuleSummary {
16    /// A unique identifier for the rule used to detect the alert.
17    #[serde(rename = "id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
18    pub id: Option<Option<String>>,
19    /// The name of the rule used to detect the alert.
20    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
21    pub name: Option<String>,
22    /// A set of tags applicable for the rule.
23    #[serde(rename = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub tags: Option<Option<Vec<String>>>,
25    /// The severity of the alert.
26    #[serde(rename = "severity", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
27    pub severity: Option<Option<Severity>>,
28    /// The security severity of the alert.
29    #[serde(rename = "security_severity_level", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub security_severity_level: Option<Option<SecuritySeverityLevel>>,
31    /// A short description of the rule used to detect the alert.
32    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
33    pub description: Option<String>,
34}
35
36impl CodeScanningAlertRuleSummary {
37    pub fn new() -> CodeScanningAlertRuleSummary {
38        CodeScanningAlertRuleSummary {
39            id: None,
40            name: None,
41            tags: None,
42            severity: None,
43            security_severity_level: None,
44            description: None,
45        }
46    }
47}
48/// The severity of the alert.
49#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
50pub enum Severity {
51    #[serde(rename = "none")]
52    None,
53    #[serde(rename = "note")]
54    Note,
55    #[serde(rename = "warning")]
56    Warning,
57    #[serde(rename = "error")]
58    Error,
59}
60
61impl Default for Severity {
62    fn default() -> Severity {
63        Self::None
64    }
65}
66/// The security severity of the alert.
67#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
68pub enum SecuritySeverityLevel {
69    #[serde(rename = "low")]
70    Low,
71    #[serde(rename = "medium")]
72    Medium,
73    #[serde(rename = "high")]
74    High,
75    #[serde(rename = "critical")]
76    Critical,
77}
78
79impl Default for SecuritySeverityLevel {
80    fn default() -> SecuritySeverityLevel {
81        Self::Low
82    }
83}
84