use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ShortBranch {
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "commit")]
pub commit: Box<models::ShortBranchCommit>,
#[serde(rename = "protected")]
pub protected: bool,
#[serde(rename = "protection", skip_serializing_if = "Option::is_none")]
pub protection: Option<Box<models::BranchProtection>>,
#[serde(rename = "protection_url", skip_serializing_if = "Option::is_none")]
pub protection_url: Option<String>,
}
impl ShortBranch {
pub fn new(name: String, commit: models::ShortBranchCommit, protected: bool) -> ShortBranch {
ShortBranch {
name,
commit: Box::new(commit),
protected,
protection: None,
protection_url: None,
}
}
}