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