@@ -10,7 +10,7 @@ public class GitlabMergeRequest {
10
10
public static final String STATUS_OPENED = "opened" ;
11
11
public static final String STATUS_MERGED = "merged" ;
12
12
public static final String STATUS_CLOSED = "closed" ;
13
-
13
+
14
14
private Integer id ;
15
15
private Integer iid ;
16
16
private String title ;
@@ -23,10 +23,18 @@ public class GitlabMergeRequest {
23
23
private GitlabMilestone milestone ;
24
24
25
25
private String [] labels ;
26
+
26
27
private List <GitlabCommitDiff > changes ;
27
28
28
- private int upvotes ;
29
- private int downvotes ;
29
+ private Integer upvotes ;
30
+
31
+ private Integer downvotes ;
32
+
33
+ @ JsonProperty ("updated_at" )
34
+ private Date updatedAt ;
35
+
36
+ @ JsonProperty ("created_at" )
37
+ private Date createdAt ;
30
38
31
39
@ JsonProperty ("target_branch" )
32
40
private String targetBranch ;
@@ -46,23 +54,64 @@ public class GitlabMergeRequest {
46
54
@ JsonProperty ("milestone_id" )
47
55
private Integer milestoneId ;
48
56
49
- @ JsonProperty ("updated_at " )
50
- private Date updatedAt ;
57
+ @ JsonProperty ("work_in_progress " )
58
+ private Boolean workInProgress ;
51
59
52
- @ JsonProperty ("created_at " )
53
- private Date createdAt ;
60
+ @ JsonProperty ("merge_when_pipeline_succeeds " )
61
+ private Boolean mergeWhenPipelineSucceeds ;
54
62
55
- @ JsonProperty ("merge_commit_sha" )
56
- private String mergeCommitSHA ;
57
-
58
63
@ JsonProperty ("merge_status" )
59
64
private String mergeStatus ;
60
65
66
+ @ JsonProperty ("sha" )
67
+ private String sha ;
68
+
69
+ @ JsonProperty ("merge_commit_sha" )
70
+ private String mergeCommitSHA ;
71
+
72
+ @ JsonProperty ("user_notes_count" )
73
+ private Integer userNotesCount ;
74
+
75
+ @ JsonProperty ("discussion_locked" )
76
+ private Boolean discussionLocked ;
77
+
78
+ @ JsonProperty ("should_remove_source_branch" )
79
+ private Boolean shouldRemoveSourceBranch ;
80
+
81
+ @ JsonProperty ("force_remove_source_branch" )
82
+ private Boolean forceRemoveSourceBranch ;
83
+
61
84
@ JsonProperty ("web_url" )
62
85
private String webUrl ;
63
86
64
- @ JsonProperty ("sha" )
65
- private String sha ;
87
+ private Boolean squash ;
88
+
89
+ @ JsonProperty ("changes_count" )
90
+ private Integer changesCount ;
91
+
92
+ @ JsonProperty ("merged_by" )
93
+ private GitlabUser mergedBy ;
94
+
95
+ @ JsonProperty ("merged_at" )
96
+ private Date mergedAt ;
97
+
98
+ @ JsonProperty ("closed_by" )
99
+ private GitlabUser closedBy ;
100
+
101
+ @ JsonProperty ("closed_at" )
102
+ private Date closedAt ;
103
+
104
+ @ JsonProperty ("latest_build_started_at" )
105
+ private Date latestBuildStartedAt ;
106
+
107
+ @ JsonProperty ("latest_build_finished_at" )
108
+ private Date latestBuildFinishedAt ;
109
+
110
+ @ JsonProperty ("first_deployed_to_production_at" )
111
+ private Date firstDeployedToProductionAt ;
112
+
113
+ @ JsonProperty ("diff_refs" )
114
+ private DiffRefs diffRefs ;
66
115
67
116
public Integer getId () {
68
117
return id ;
@@ -281,4 +330,96 @@ public String getSha() {
281
330
public void setSha (String sha ) {
282
331
this .sha = sha ;
283
332
}
333
+
334
+ public Boolean isWorkInProgress () {
335
+ return workInProgress ;
336
+ }
337
+
338
+
339
+ public Boolean isMergeWhenPipelineSucceeds () {
340
+ return mergeWhenPipelineSucceeds ;
341
+ }
342
+
343
+ public Integer getUserNotesCount () {
344
+ return userNotesCount ;
345
+ }
346
+
347
+ public Boolean isDiscussionLocked () {
348
+ return discussionLocked ;
349
+ }
350
+
351
+ public Boolean isShouldRemoveSourceBranch () {
352
+ return shouldRemoveSourceBranch ;
353
+ }
354
+
355
+ public boolean isForceRemoveSourceBranch () {
356
+ return forceRemoveSourceBranch ;
357
+ }
358
+
359
+ public Boolean isSquash () {
360
+ return squash ;
361
+ }
362
+
363
+ public Integer getChangesCount () {
364
+ return changesCount ;
365
+ }
366
+
367
+ public GitlabUser getMergedBy () {
368
+ return mergedBy ;
369
+ }
370
+
371
+ public Date getMergedAt () {
372
+ return mergedAt ;
373
+ }
374
+
375
+ public GitlabUser getClosedBy () {
376
+ return closedBy ;
377
+ }
378
+
379
+ public Date getClosedAt () {
380
+ return closedAt ;
381
+ }
382
+
383
+ public Date getLatestBuildStartedAt () {
384
+ return latestBuildStartedAt ;
385
+ }
386
+
387
+ public Date getLatestBuildFinishedAt () {
388
+ return latestBuildFinishedAt ;
389
+ }
390
+
391
+ public Date getFirstDeployedToProductionAt () {
392
+ return firstDeployedToProductionAt ;
393
+ }
394
+
395
+ public String getBaseSha () {
396
+ return diffRefs == null ? null : diffRefs .baseSha ;
397
+ }
398
+
399
+ public String getHeadSha () {
400
+ return diffRefs == null ? null : diffRefs .headSha ;
401
+ }
402
+
403
+ public String getStartSha () {
404
+ return diffRefs == null ? null : diffRefs .startSha ;
405
+ }
406
+
407
+ /**
408
+ * Class representing the diff_refs json object, which is just a collection
409
+ * of sha references of the merge request. It is currently not provided by
410
+ * GitLab when fetching multiple merge requests.
411
+ *
412
+ * @author Patrizio Bonzani
413
+ */
414
+ private static class DiffRefs {
415
+
416
+ @ JsonProperty ("base_sha" )
417
+ private String baseSha ;
418
+
419
+ @ JsonProperty ("head_sha" )
420
+ private String headSha ;
421
+
422
+ @ JsonProperty ("start_sha" )
423
+ private String startSha ;
424
+ }
284
425
}
0 commit comments