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