1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* 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};
/// RepositoryRuleParamsCodeScanningTool : A tool that must provide code scanning results for this rule to pass.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RepositoryRuleParamsCodeScanningTool {
/// 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).\"
#[serde(rename = "alerts_threshold")]
pub alerts_threshold: AlertsThreshold,
/// 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).\"
#[serde(rename = "security_alerts_threshold")]
pub security_alerts_threshold: SecurityAlertsThreshold,
/// The name of a code scanning tool
#[serde(rename = "tool")]
pub tool: String,
}
impl RepositoryRuleParamsCodeScanningTool {
/// A tool that must provide code scanning results for this rule to pass.
pub fn new(alerts_threshold: AlertsThreshold, security_alerts_threshold: SecurityAlertsThreshold, tool: String) -> RepositoryRuleParamsCodeScanningTool {
RepositoryRuleParamsCodeScanningTool {
alerts_threshold,
security_alerts_threshold,
tool,
}
}
}
/// 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).\"
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AlertsThreshold {
#[serde(rename = "none")]
None,
#[serde(rename = "errors")]
Errors,
#[serde(rename = "errors_and_warnings")]
ErrorsAndWarnings,
#[serde(rename = "all")]
All,
}
impl Default for AlertsThreshold {
fn default() -> AlertsThreshold {
Self::None
}
}
/// 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).\"
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SecurityAlertsThreshold {
#[serde(rename = "none")]
None,
#[serde(rename = "critical")]
Critical,
#[serde(rename = "high_or_higher")]
HighOrHigher,
#[serde(rename = "medium_or_higher")]
MediumOrHigher,
#[serde(rename = "all")]
All,
}
impl Default for SecurityAlertsThreshold {
fn default() -> SecurityAlertsThreshold {
Self::None
}
}