openapi_github/models/
rule_suites_inner.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 RuleSuitesInner {
16    /// The unique identifier of the rule insight.
17    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
18    pub id: Option<i32>,
19    /// The number that identifies the user.
20    #[serde(rename = "actor_id", skip_serializing_if = "Option::is_none")]
21    pub actor_id: Option<i32>,
22    /// The handle for the GitHub user account.
23    #[serde(rename = "actor_name", skip_serializing_if = "Option::is_none")]
24    pub actor_name: Option<String>,
25    /// The first commit sha before the push evaluation.
26    #[serde(rename = "before_sha", skip_serializing_if = "Option::is_none")]
27    pub before_sha: Option<String>,
28    /// The last commit sha in the push evaluation.
29    #[serde(rename = "after_sha", skip_serializing_if = "Option::is_none")]
30    pub after_sha: Option<String>,
31    /// The ref name that the evaluation ran on.
32    #[serde(rename = "ref", skip_serializing_if = "Option::is_none")]
33    pub r#ref: Option<String>,
34    /// The ID of the repository associated with the rule evaluation.
35    #[serde(rename = "repository_id", skip_serializing_if = "Option::is_none")]
36    pub repository_id: Option<i32>,
37    /// The name of the repository without the `.git` extension.
38    #[serde(rename = "repository_name", skip_serializing_if = "Option::is_none")]
39    pub repository_name: Option<String>,
40    #[serde(rename = "pushed_at", skip_serializing_if = "Option::is_none")]
41    pub pushed_at: Option<String>,
42    /// The result of the rule evaluations for rules with the `active` enforcement status.
43    #[serde(rename = "result", skip_serializing_if = "Option::is_none")]
44    pub result: Option<Result>,
45    /// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`.
46    #[serde(rename = "evaluation_result", skip_serializing_if = "Option::is_none")]
47    pub evaluation_result: Option<EvaluationResult>,
48}
49
50impl RuleSuitesInner {
51    pub fn new() -> RuleSuitesInner {
52        RuleSuitesInner {
53            id: None,
54            actor_id: None,
55            actor_name: None,
56            before_sha: None,
57            after_sha: None,
58            r#ref: None,
59            repository_id: None,
60            repository_name: None,
61            pushed_at: None,
62            result: None,
63            evaluation_result: None,
64        }
65    }
66}
67/// The result of the rule evaluations for rules with the `active` enforcement status.
68#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
69pub enum Result {
70    #[serde(rename = "pass")]
71    Pass,
72    #[serde(rename = "fail")]
73    Fail,
74    #[serde(rename = "bypass")]
75    Bypass,
76}
77
78impl Default for Result {
79    fn default() -> Result {
80        Self::Pass
81    }
82}
83/// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`.
84#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
85pub enum EvaluationResult {
86    #[serde(rename = "pass")]
87    Pass,
88    #[serde(rename = "fail")]
89    Fail,
90}
91
92impl Default for EvaluationResult {
93    fn default() -> EvaluationResult {
94        Self::Pass
95    }
96}
97