Skip to content

Commit d29caf1

Browse files
committed
Fixes
1 parent d60d8df commit d29caf1

File tree

4 files changed

+168
-6
lines changed

4 files changed

+168
-6
lines changed

gitlab4j-models/src/main/java/org/gitlab4j/api/models/LineRange.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
/*
2-
* LineRange.java
3-
* Copyright 2025 Qunhe Tech, all rights reserved.
4-
* Qunhe PROPRIETARY/CONFIDENTIAL, any form of usage is subject to approval.
5-
*/
6-
71
package org.gitlab4j.api.models;
82

93
import java.io.Serializable;

gitlab4j-models/src/main/java/org/gitlab4j/api/models/Note.java

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.io.Serializable;
44
import java.util.Date;
5+
import java.util.List;
56

67
import org.gitlab4j.models.utils.JacksonJson;
78
import org.gitlab4j.models.utils.JacksonJsonEnumHelper;
@@ -96,7 +97,9 @@ public String toString() {
9697
// Use String for noteableType until the constant is fixed in the GitLab API
9798
private String noteableType;
9899

100+
private Long projectId;
99101
private Long noteableIid;
102+
private String commitId;
100103
private Boolean system;
101104
private String title;
102105
private Date updatedAt;
@@ -109,6 +112,7 @@ public String toString() {
109112
private Type type;
110113

111114
private Position position;
115+
private List<Suggestion> suggestions;
112116

113117
public String getAttachment() {
114118
return attachment;
@@ -190,6 +194,14 @@ public void setNoteableType(String noteableType) {
190194
this.noteableType = noteableType;
191195
}
192196

197+
public Long getProjectId() {
198+
return projectId;
199+
}
200+
201+
public void setProjectId(Long projectId) {
202+
this.projectId = projectId;
203+
}
204+
193205
public Long getNoteableIid() {
194206
return noteableIid;
195207
}
@@ -198,6 +210,14 @@ public void setNoteableIid(Long noteableIid) {
198210
this.noteableIid = noteableIid;
199211
}
200212

213+
public String getCommitId() {
214+
return commitId;
215+
}
216+
217+
public void setCommitId(String commitId) {
218+
this.commitId = commitId;
219+
}
220+
201221
public Boolean getSystem() {
202222
return system;
203223
}
@@ -286,6 +306,14 @@ public void setInternal(Boolean internal) {
286306
this.internal = internal;
287307
}
288308

309+
public List<Suggestion> getSuggestions() {
310+
return suggestions;
311+
}
312+
313+
public void setSuggestions(List<Suggestion> suggestions) {
314+
this.suggestions = suggestions;
315+
}
316+
289317
@Override
290318
public String toString() {
291319
return (JacksonJson.toJsonString(this));
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
package org.gitlab4j.api.models;
2+
3+
import java.io.Serializable;
4+
5+
import org.gitlab4j.models.utils.JacksonJson;
6+
7+
public class Suggestion implements Serializable {
8+
private static final long serialVersionUID = 1L;
9+
10+
private Long id;
11+
private Long fromLine;
12+
private Long toLine;
13+
private Boolean appliable;
14+
private Boolean applied;
15+
private String fromContent;
16+
private String toContent;
17+
18+
public Long getId() {
19+
return id;
20+
}
21+
22+
public void setId(Long id) {
23+
this.id = id;
24+
}
25+
26+
public Long getFromLine() {
27+
return fromLine;
28+
}
29+
30+
public void setFromLine(Long fromLine) {
31+
this.fromLine = fromLine;
32+
}
33+
34+
public Long getToLine() {
35+
return toLine;
36+
}
37+
38+
public void setToLine(Long toLine) {
39+
this.toLine = toLine;
40+
}
41+
42+
public Boolean getAppliable() {
43+
return appliable;
44+
}
45+
46+
public void setAppliable(Boolean appliable) {
47+
this.appliable = appliable;
48+
}
49+
50+
public Boolean getApplied() {
51+
return applied;
52+
}
53+
54+
public void setApplied(Boolean applied) {
55+
this.applied = applied;
56+
}
57+
58+
public String getFromContent() {
59+
return fromContent;
60+
}
61+
62+
public void setFromContent(String fromContent) {
63+
this.fromContent = fromContent;
64+
}
65+
66+
public String getToContent() {
67+
return toContent;
68+
}
69+
70+
public void setToContent(String toContent) {
71+
this.toContent = toContent;
72+
}
73+
74+
@Override
75+
public String toString() {
76+
return (JacksonJson.toJsonString(this));
77+
}
78+
}

gitlab4j-models/src/test/resources/org/gitlab4j/models/merge-request-discussions.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,67 @@
6868
"resolvable": true
6969
}
7070
]
71+
},
72+
{
73+
"id": "87805b7c09016a7058e91bdbe7b29d1f284a39e6",
74+
"individual_note": false,
75+
"notes": [
76+
{
77+
"id": 1128,
78+
"type": "DiffNote",
79+
"body": "diff comment",
80+
"author": {
81+
"id": 1,
82+
"name": "root",
83+
"username": "root",
84+
"state": "active",
85+
"avatar_url": "https://www.gravatar.com/avatar/00afb8fb6ab07c3ee3e9c1f38777e2f4?s=80&d=identicon",
86+
"web_url": "http://localhost:3000/root"
87+
},
88+
"created_at": "2018-03-04T09:17:22.520Z",
89+
"updated_at": "2018-03-04T09:17:22.520Z",
90+
"system": false,
91+
"noteable_id": 3,
92+
"noteable_type": "MergeRequest",
93+
"project_id": 5,
94+
"commit_id": "4803c71e6b1833ca72b8b26ef2ecd5adc8a38031",
95+
"position": {
96+
"base_sha": "b5d6e7b1613fca24d250fa8e5bc7bcc3dd6002ef",
97+
"start_sha": "7c9c2ead8a320fb7ba0b4e234bd9529a2614e306",
98+
"head_sha": "4803c71e6b1833ca72b8b26ef2ecd5adc8a38031",
99+
"old_path": "package.json",
100+
"new_path": "package.json",
101+
"position_type": "text",
102+
"old_line": 27,
103+
"new_line": 27,
104+
"line_range": {
105+
"start": {
106+
"line_code": "588440f66559714280628a4f9799f0c4eb880a4a_10_10",
107+
"type": "new",
108+
"new_line": 10
109+
},
110+
"end": {
111+
"line_code": "588440f66559714280628a4f9799f0c4eb880a4a_11_11",
112+
"type": "old",
113+
"old_line": 11,
114+
"new_line": 11
115+
}
116+
}
117+
},
118+
"resolved": false,
119+
"resolvable": true,
120+
"suggestions": [
121+
{
122+
"id": 1,
123+
"from_line": 27,
124+
"to_line": 27,
125+
"appliable": true,
126+
"applied": false,
127+
"from_content": "x",
128+
"to_content": "b"
129+
}
130+
]
131+
}
132+
]
71133
}
72134
]

0 commit comments

Comments
 (0)