Commit 02c93370 authored by Adam Lesiak's avatar Adam Lesiak Committed by Greg Messner
Browse files

Fix #411 Added missing fields in merge_request (#412)

Added fields: 
 - allow_collaboration
 - allow_maintainer_to_push
 - closed_at
 - closed_by
 - discussion_locked
 - merged_at
 - merged_by
 - task_completion_status
 - time_stats
Renamed fields: 
 - merge_when_build_succeeds to merge_when_pipeline_succeeds
parent 8dc9a96f
......@@ -10,12 +10,17 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
public class MergeRequest {
private Boolean allowCollaboration;
private Boolean allowMaintainerToPush;
private Integer approvalsBeforeMerge;
private Assignee assignee;
private Author author;
private List<Diff> changes;
private Date closedAt;
private Participant closedBy;
private Date createdAt;
private String description;
private Boolean discussionLocked;
private Integer downvotes;
private Boolean forceRemoveSourceBranch;
private Integer id;
......@@ -23,7 +28,9 @@ public class MergeRequest {
private List<String> labels;
private String mergeCommitSha;
private String mergeStatus;
private Boolean mergeWhenBuildSucceeds;
private Date mergedAt;
private Participant mergedBy;
private Boolean mergeWhenPipelineSucceeds;
private Milestone milestone;
private Integer projectId;
private String sha;
......@@ -35,6 +42,8 @@ public class MergeRequest {
private Boolean subscribed;
private String targetBranch;
private Integer targetProjectId;
private TaskCompletionStatus taskCompletionStatus;
private TimeStats timeStats;
private String title;
private Date updatedAt;
private Integer upvotes;
......@@ -51,6 +60,22 @@ public class MergeRequest {
@JsonDeserialize(using = JacksonJson.UserListDeserializer.class)
private List<User> approvedBy;
public Boolean getAllowCollaboration() {
return allowCollaboration;
}
public void setAllowCollaboration(Boolean allowCollaboration) {
this.allowCollaboration = allowCollaboration;
}
public Boolean getAllowMaintainerToPush() {
return allowMaintainerToPush;
}
public void setAllowMaintainerToPush(Boolean allowMaintainerToPush) {
this.allowMaintainerToPush = allowMaintainerToPush;
}
public Integer getApprovalsBeforeMerge() {
return approvalsBeforeMerge;
}
......@@ -83,6 +108,22 @@ public class MergeRequest {
this.changes = changes;
}
public Date getClosedAt() {
return closedAt;
}
public void setClosedAt(Date closedAt) {
this.closedAt = closedAt;
}
public Participant getClosedBy() {
return closedBy;
}
public void setClosedBy(Participant closedBy) {
this.closedBy = closedBy;
}
public Date getCreatedAt() {
return createdAt;
}
......@@ -99,6 +140,14 @@ public class MergeRequest {
this.description = description;
}
public Boolean getDiscussionLocked() {
return discussionLocked;
}
public void setDiscussionLocked(Boolean discussionLocked) {
this.discussionLocked = discussionLocked;
}
public Integer getDownvotes() {
return downvotes;
}
......@@ -155,12 +204,28 @@ public class MergeRequest {
this.mergeStatus = mergeStatus;
}
public Boolean getMergeWhenBuildSucceeds() {
return mergeWhenBuildSucceeds;
public Date getMergedAt() {
return mergedAt;
}
public void setMergedAt(Date mergedAt) {
this.mergedAt = mergedAt;
}
public Participant getMergedBy() {
return mergedBy;
}
public void setMergedBy(Participant mergedBy) {
this.mergedBy = mergedBy;
}
public Boolean getMergeWhenPipelineSucceeds() {
return mergeWhenPipelineSucceeds;
}
public void setMergeWhenBuildSucceeds(Boolean mergeWhenBuildSucceeds) {
this.mergeWhenBuildSucceeds = mergeWhenBuildSucceeds;
public void setMergeWhenPipelineSucceeds(Boolean mergeWhenPipelineSucceeds) {
this.mergeWhenPipelineSucceeds = mergeWhenPipelineSucceeds;
}
public Milestone getMilestone() {
......@@ -251,6 +316,22 @@ public class MergeRequest {
this.targetProjectId = targetProjectId;
}
public TaskCompletionStatus getTaskCompletionStatus() {
return taskCompletionStatus;
}
public void setTaskCompletionStatus(TaskCompletionStatus taskCompletionStatus) {
this.taskCompletionStatus = taskCompletionStatus;
}
public TimeStats getTimeStats() {
return timeStats;
}
public void setTimeStats(TimeStats timeStats) {
this.timeStats = timeStats;
}
public String getTitle() {
return title;
}
......
package org.gitlab4j.api.models;
import org.gitlab4j.api.utils.JacksonJson;
public class TaskCompletionStatus {
private Integer count;
private Integer completedCount;
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
this.count = count;
}
public Integer getCompletedCount() {
return completedCount;
}
public void setCompletedCount(Integer completedCount) {
this.completedCount = completedCount;
}
@Override
public String toString() {
return (JacksonJson.toJsonString(this));
}
}
......@@ -10,6 +10,15 @@
"downvotes":0,
"created_at": "2016-12-03T17:23:34Z",
"updated_at": "2016-12-03T17:23:34Z",
"merged_at": "2016-12-03T17:23:34Z",
"merged_by": {
"id": 7,
"name": "James Bond",
"username": "james.bond",
"state": "active",
"avatar_url": "https://www.google.com/",
"web_url": "https://www.google.com/"
},
"author":{
"id":1,
"username": "admin",
......@@ -26,6 +35,20 @@
"state":"active",
"created_at":"2012-04-29T08:46:00Z"
},
"allow_collaboration": false,
"allow_maintainer_to_push": false,
"discussion_locked": false,
"merge_when_pipeline_succeeds": false,
"task_completion_status":{
"count":0,
"completed_count":0
},
"time_stats": {
"time_estimate": 0,
"total_time_spent": 0,
"human_time_estimate": "3h30m",
"human_total_time_spent": "0m"
},
"diff_refs": {
"base_sha": "c380d3acebd181f13629a25d2e2acca46ffe1e00",
"head_sha": "2be7ddb704c7b6b83732fdd5b9f09d5a397b5f8f",
......
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