Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 86 additions & 5 deletions src/main/java/org/gitlab4j/api/models/MergeRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,27 @@

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;
private Integer iid;
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;
Expand All @@ -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;
Expand All @@ -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;
}
Expand Down Expand Up @@ -83,6 +108,22 @@ public void setChanges(List<Diff> changes) {
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;
}
Expand All @@ -99,6 +140,14 @@ public void setDescription(String description) {
this.description = description;
}

public Boolean getDiscussionLocked() {
return discussionLocked;
}

public void setDiscussionLocked(Boolean discussionLocked) {
this.discussionLocked = discussionLocked;
}

public Integer getDownvotes() {
return downvotes;
}
Expand Down Expand Up @@ -155,12 +204,28 @@ public void setMergeStatus(String mergeStatus) {
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() {
Expand Down Expand Up @@ -251,6 +316,22 @@ public void setTargetProjectId(Integer targetProjectId) {
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;
}
Expand Down
31 changes: 31 additions & 0 deletions src/main/java/org/gitlab4j/api/models/TaskCompletionStatus.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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));
}

}
23 changes: 23 additions & 0 deletions src/test/resources/org/gitlab4j/api/merge-request.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down