openapi_github/models/
repository_rule_pull_request.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/// RepositoryRulePullRequest : Require all commits be made to a non-target branch and submitted via a pull request before they can be merged.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct RepositoryRulePullRequest {
17    #[serde(rename = "type")]
18    pub r#type: Type,
19    #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")]
20    pub parameters: Option<Box<models::RepositoryRulePullRequestParameters>>,
21}
22
23impl RepositoryRulePullRequest {
24    /// Require all commits be made to a non-target branch and submitted via a pull request before they can be merged.
25    pub fn new(r#type: Type) -> RepositoryRulePullRequest {
26        RepositoryRulePullRequest {
27            r#type,
28            parameters: None,
29        }
30    }
31}
32/// 
33#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
34pub enum Type {
35    #[serde(rename = "pull_request")]
36    PullRequest,
37}
38
39impl Default for Type {
40    fn default() -> Type {
41        Self::PullRequest
42    }
43}
44