From 26c20a7a224a066bb06b71461143ec517669dd61 Mon Sep 17 00:00:00 2001 From: "Jeffrey.Nelson" Date: Thu, 22 Dec 2016 11:55:01 -0600 Subject: [PATCH] add branch protection attributes --- .../java/org/kohsuke/github/GHBranch.java | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/kohsuke/github/GHBranch.java b/src/main/java/org/kohsuke/github/GHBranch.java index 4c80db9ef4..9870732d0d 100644 --- a/src/main/java/org/kohsuke/github/GHBranch.java +++ b/src/main/java/org/kohsuke/github/GHBranch.java @@ -1,13 +1,16 @@ package org.kohsuke.github; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import org.kohsuke.github.BranchProtection.RequiredStatusChecks; +import static org.kohsuke.github.Previews.LOKI; import java.io.IOException; import java.util.Arrays; import java.util.Collection; -import static org.kohsuke.github.Previews.LOKI; +import org.kohsuke.github.BranchProtection.RequiredStatusChecks; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; /** * A branch in a repository. @@ -22,6 +25,10 @@ public class GHBranch { private String name; private Commit commit; + @JsonProperty("protected") + private boolean protection; + private String protection_url; + public static class Commit { String sha; @@ -44,6 +51,15 @@ public GHRepository getOwner() { public String getName() { return name; } + + public boolean isProtected() { + return protection; + } + + public String getProtection_url() { + return protection_url; + } + /** * The commit that this branch currently points to.