openapi_github/models/
repository_rule_ruleset_info.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/// RepositoryRuleRulesetInfo : User-defined metadata to store domain-specific information limited to 8 keys with scalar values.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct RepositoryRuleRulesetInfo {
17    /// The type of source for the ruleset that includes this rule.
18    #[serde(rename = "ruleset_source_type", skip_serializing_if = "Option::is_none")]
19    pub ruleset_source_type: Option<RulesetSourceType>,
20    /// The name of the source of the ruleset that includes this rule.
21    #[serde(rename = "ruleset_source", skip_serializing_if = "Option::is_none")]
22    pub ruleset_source: Option<String>,
23    /// The ID of the ruleset that includes this rule.
24    #[serde(rename = "ruleset_id", skip_serializing_if = "Option::is_none")]
25    pub ruleset_id: Option<i32>,
26}
27
28impl RepositoryRuleRulesetInfo {
29    /// User-defined metadata to store domain-specific information limited to 8 keys with scalar values.
30    pub fn new() -> RepositoryRuleRulesetInfo {
31        RepositoryRuleRulesetInfo {
32            ruleset_source_type: None,
33            ruleset_source: None,
34            ruleset_id: None,
35        }
36    }
37}
38/// The type of source for the ruleset that includes this rule.
39#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
40pub enum RulesetSourceType {
41    #[serde(rename = "Repository")]
42    Repository,
43    #[serde(rename = "Organization")]
44    Organization,
45}
46
47impl Default for RulesetSourceType {
48    fn default() -> RulesetSourceType {
49        Self::Repository
50    }
51}
52