openapi_github/models/
repository_rule_enforcement.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/// RepositoryRuleEnforcement : The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise).
15/// The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page (`evaluate` is only available with GitHub Enterprise).
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum RepositoryRuleEnforcement {
18    #[serde(rename = "disabled")]
19    Disabled,
20    #[serde(rename = "active")]
21    Active,
22    #[serde(rename = "evaluate")]
23    Evaluate,
24
25}
26
27impl std::fmt::Display for RepositoryRuleEnforcement {
28    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29        match self {
30            Self::Disabled => write!(f, "disabled"),
31            Self::Active => write!(f, "active"),
32            Self::Evaluate => write!(f, "evaluate"),
33        }
34    }
35}
36
37impl Default for RepositoryRuleEnforcement {
38    fn default() -> RepositoryRuleEnforcement {
39        Self::Disabled
40    }
41}
42