openapi_github/models/
repository_rule_params_code_scanning_tool.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/// RepositoryRuleParamsCodeScanningTool : A tool that must provide code scanning results for this rule to pass.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct RepositoryRuleParamsCodeScanningTool {
17    /// The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see \"[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels).\"
18    #[serde(rename = "alerts_threshold")]
19    pub alerts_threshold: AlertsThreshold,
20    /// The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see \"[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels).\"
21    #[serde(rename = "security_alerts_threshold")]
22    pub security_alerts_threshold: SecurityAlertsThreshold,
23    /// The name of a code scanning tool
24    #[serde(rename = "tool")]
25    pub tool: String,
26}
27
28impl RepositoryRuleParamsCodeScanningTool {
29    /// A tool that must provide code scanning results for this rule to pass.
30    pub fn new(alerts_threshold: AlertsThreshold, security_alerts_threshold: SecurityAlertsThreshold, tool: String) -> RepositoryRuleParamsCodeScanningTool {
31        RepositoryRuleParamsCodeScanningTool {
32            alerts_threshold,
33            security_alerts_threshold,
34            tool,
35        }
36    }
37}
38/// The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see \"[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels).\"
39#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
40pub enum AlertsThreshold {
41    #[serde(rename = "none")]
42    None,
43    #[serde(rename = "errors")]
44    Errors,
45    #[serde(rename = "errors_and_warnings")]
46    ErrorsAndWarnings,
47    #[serde(rename = "all")]
48    All,
49}
50
51impl Default for AlertsThreshold {
52    fn default() -> AlertsThreshold {
53        Self::None
54    }
55}
56/// The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see \"[About code scanning alerts](https://docs.github.com/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels).\"
57#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
58pub enum SecurityAlertsThreshold {
59    #[serde(rename = "none")]
60    None,
61    #[serde(rename = "critical")]
62    Critical,
63    #[serde(rename = "high_or_higher")]
64    HighOrHigher,
65    #[serde(rename = "medium_or_higher")]
66    MediumOrHigher,
67    #[serde(rename = "all")]
68    All,
69}
70
71impl Default for SecurityAlertsThreshold {
72    fn default() -> SecurityAlertsThreshold {
73        Self::None
74    }
75}
76