openapi_github/models/
repository_rule_detailed_one_of_7.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 RepositoryRuleDetailedOneOf7 {
16    #[serde(rename = "type")]
17    pub r#type: Type,
18    #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")]
19    pub parameters: Option<Box<models::RepositoryRuleRequiredStatusChecksParameters>>,
20    /// The type of source for the ruleset that includes this rule.
21    #[serde(rename = "ruleset_source_type", skip_serializing_if = "Option::is_none")]
22    pub ruleset_source_type: Option<RulesetSourceType>,
23    /// The name of the source of the ruleset that includes this rule.
24    #[serde(rename = "ruleset_source", skip_serializing_if = "Option::is_none")]
25    pub ruleset_source: Option<String>,
26    /// The ID of the ruleset that includes this rule.
27    #[serde(rename = "ruleset_id", skip_serializing_if = "Option::is_none")]
28    pub ruleset_id: Option<i32>,
29}
30
31impl RepositoryRuleDetailedOneOf7 {
32    pub fn new(r#type: Type) -> RepositoryRuleDetailedOneOf7 {
33        RepositoryRuleDetailedOneOf7 {
34            r#type,
35            parameters: None,
36            ruleset_source_type: None,
37            ruleset_source: None,
38            ruleset_id: None,
39        }
40    }
41}
42/// 
43#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
44pub enum Type {
45    #[serde(rename = "required_status_checks")]
46    RequiredStatusChecks,
47}
48
49impl Default for Type {
50    fn default() -> Type {
51        Self::RequiredStatusChecks
52    }
53}
54/// The type of source for the ruleset that includes this rule.
55#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
56pub enum RulesetSourceType {
57    #[serde(rename = "Repository")]
58    Repository,
59    #[serde(rename = "Organization")]
60    Organization,
61}
62
63impl Default for RulesetSourceType {
64    fn default() -> RulesetSourceType {
65        Self::Repository
66    }
67}
68