Unverified Commit 847ce9ee authored by Gautier de Saint Martin Lacaze's avatar Gautier de Saint Martin Lacaze
Browse files

Fix #626 : Add missing properties to Branch model

parent b442f13a
...@@ -11,6 +11,9 @@ public class Branch { ...@@ -11,6 +11,9 @@ public class Branch {
private Boolean merged; private Boolean merged;
private String name; private String name;
private Boolean isProtected; private Boolean isProtected;
private Boolean isDefault;
private Boolean canPush;
private String webUrl;
public Commit getCommit() { public Commit getCommit() {
return commit; return commit;
...@@ -60,6 +63,30 @@ public class Branch { ...@@ -60,6 +63,30 @@ public class Branch {
this.isProtected = isProtected; this.isProtected = isProtected;
} }
public Boolean getDefault() {
return isDefault;
}
public void setDefault(Boolean isDefault) {
this.isDefault = isDefault;
}
public Boolean getCanPush() {
return canPush;
}
public void setCanPush(Boolean canPush) {
this.canPush = canPush;
}
public String getWebUrl() {
return webUrl;
}
public void setWebUrl(String webUrl) {
this.webUrl = webUrl;
}
public static final boolean isValid(Branch branch) { public static final boolean isValid(Branch branch) {
return (branch != null && branch.getName() != null); return (branch != null && branch.getName() != null);
} }
...@@ -80,11 +107,23 @@ public class Branch { ...@@ -80,11 +107,23 @@ public class Branch {
return this; return this;
} }
/**
* Set the merged attribute
* @param merged
* @deprecated Use {@link #withMerged(Boolean)} instead
* @return Current branch instance
*/
@Deprecated
public Branch withDerged(Boolean merged) { public Branch withDerged(Boolean merged) {
this.merged = merged; this.merged = merged;
return this; return this;
} }
public Branch withMerged(Boolean merged) {
this.merged = merged;
return this;
}
public Branch withName(String name) { public Branch withName(String name) {
this.name = name; this.name = name;
return this; return this;
......
...@@ -2,8 +2,11 @@ ...@@ -2,8 +2,11 @@
"name": "master", "name": "master",
"merged": false, "merged": false,
"protected": true, "protected": true,
"default": true,
"developers_can_push": false, "developers_can_push": false,
"developers_can_merge": false, "developers_can_merge": false,
"can_push": true,
"web_url": "http://gitlab.example.com/my-group/my-project/-/tree/master",
"commit": { "commit": {
"author_email": "john@example.com", "author_email": "john@example.com",
"author_name": "John Smith", "author_name": "John Smith",
...@@ -12,6 +15,8 @@ ...@@ -12,6 +15,8 @@
"committer_email": "john@example.com", "committer_email": "john@example.com",
"committer_name": "John Smith", "committer_name": "John Smith",
"id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c", "id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c",
"short_id": "7b5c3cc",
"title": "add projects API",
"message": "add projects API", "message": "add projects API",
"parent_ids": [ "parent_ids": [
"4ad91d3c1144c406e50c7b33bae684bd6837faf8" "4ad91d3c1144c406e50c7b33bae684bd6837faf8"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment