openapi_github/models/
short_branch.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/// ShortBranch : Short Branch
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ShortBranch {
17    #[serde(rename = "name")]
18    pub name: String,
19    #[serde(rename = "commit")]
20    pub commit: Box<models::ShortBranchCommit>,
21    #[serde(rename = "protected")]
22    pub protected: bool,
23    #[serde(rename = "protection", skip_serializing_if = "Option::is_none")]
24    pub protection: Option<Box<models::BranchProtection>>,
25    #[serde(rename = "protection_url", skip_serializing_if = "Option::is_none")]
26    pub protection_url: Option<String>,
27}
28
29impl ShortBranch {
30    /// Short Branch
31    pub fn new(name: String, commit: models::ShortBranchCommit, protected: bool) -> ShortBranch {
32        ShortBranch {
33            name,
34            commit: Box::new(commit),
35            protected,
36            protection: None,
37            protection_url: None,
38        }
39    }
40}
41