openapi_github/models/
code_scanning_alert_severity.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/// CodeScanningAlertSeverity : Severity of a code scanning alert.
15/// Severity of a code scanning alert.
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum CodeScanningAlertSeverity {
18    #[serde(rename = "critical")]
19    Critical,
20    #[serde(rename = "high")]
21    High,
22    #[serde(rename = "medium")]
23    Medium,
24    #[serde(rename = "low")]
25    Low,
26    #[serde(rename = "warning")]
27    Warning,
28    #[serde(rename = "note")]
29    Note,
30    #[serde(rename = "error")]
31    Error,
32
33}
34
35impl std::fmt::Display for CodeScanningAlertSeverity {
36    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
37        match self {
38            Self::Critical => write!(f, "critical"),
39            Self::High => write!(f, "high"),
40            Self::Medium => write!(f, "medium"),
41            Self::Low => write!(f, "low"),
42            Self::Warning => write!(f, "warning"),
43            Self::Note => write!(f, "note"),
44            Self::Error => write!(f, "error"),
45        }
46    }
47}
48
49impl Default for CodeScanningAlertSeverity {
50    fn default() -> CodeScanningAlertSeverity {
51        Self::Critical
52    }
53}
54