Skip to content

Commit 8132cb9

Browse files
committed
Add methods to manage TODOs
1 parent 50bad81 commit 8132cb9

29 files changed

+1084
-41
lines changed

GenerateGitlabClient.java

Lines changed: 114 additions & 15 deletions
Large diffs are not rendered by default.

src/main/java/graphql/gitlab/api/WorkitemClientApi.java

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import graphql.gitlab.model.CreateBoardPayload;
2222
import graphql.gitlab.model.CreateNoteInput;
2323
import graphql.gitlab.model.CreateNotePayload;
24+
import graphql.gitlab.model.CurrentUser;
2425
import graphql.gitlab.model.DestroyBoardInput;
2526
import graphql.gitlab.model.DestroyBoardListInput;
2627
import graphql.gitlab.model.DestroyBoardListPayload;
@@ -49,6 +50,8 @@
4950
import graphql.gitlab.model.Project;
5051
import graphql.gitlab.model.ProjectContainingIssueBoards;
5152
import graphql.gitlab.model.ProjectContainingSingleIssueBoard;
53+
import graphql.gitlab.model.TodoMarkDoneInput;
54+
import graphql.gitlab.model.TodoMarkDonePayload;
5255
import graphql.gitlab.model.UpdateBoardInput;
5356
import graphql.gitlab.model.UpdateBoardListInput;
5457
import graphql.gitlab.model.UpdateBoardListPayload;
@@ -82,6 +85,12 @@ public interface WorkitemClientApi {
8285
@Query("boardList")
8386
BoardList getIssueBoardList(@Name("id") @NonNull ListID id);
8487

88+
/**
89+
* Get information about current user.
90+
*/
91+
@Query("currentUser")
92+
CurrentUser getCurrentUserTodos(@NestedParameter("todos") @Name("after") String todosAfter);
93+
8594
@Query("epicBoardList")
8695
EpicList getEpicBoardList(@Name("id") @NonNull BoardsEpicListID id);
8796

@@ -143,9 +152,9 @@ public interface WorkitemClientApi {
143152
CreateBoardPayload createIssueBoard(@Name("input") @NonNull @Source CreateBoardInput input);
144153

145154
/**
146-
* Creates a Note.
147-
* If the body of the Note contains only quick actions,
148-
* the Note will be destroyed during an update, and no Note will be
155+
* Creates a Note.<br>
156+
* If the body of the Note contains only quick actions,<br>
157+
* the Note will be destroyed during an update, and no Note will be<br>
149158
* returned.
150159
*/
151160
@Mutation("createNote")
@@ -178,6 +187,9 @@ public interface WorkitemClientApi {
178187
@Mutation("epicBoardUpdate")
179188
EpicBoardUpdatePayload updateEpicBoard(@Name("input") @NonNull @Source EpicBoardUpdateInput input);
180189

190+
@Mutation("todoMarkDone")
191+
TodoMarkDonePayload todoMarkDone(@Name("input") @NonNull @Source TodoMarkDoneInput input);
192+
181193
@Mutation("updateBoard")
182194
UpdateBoardPayload updateIssueBoard(@Name("input") @NonNull @Source UpdateBoardInput input);
183195

@@ -188,9 +200,9 @@ public interface WorkitemClientApi {
188200
UpdateEpicBoardListPayload updateEpicBoardList(@Name("input") @NonNull @Source UpdateEpicBoardListInput input);
189201

190202
/**
191-
* Updates a Note.
192-
* If the body of the Note contains only quick actions,
193-
* the Note will be destroyed during an update, and no Note will be
203+
* Updates a Note.<br>
204+
* If the body of the Note contains only quick actions,<br>
205+
* the Note will be destroyed during an update, and no Note will be<br>
194206
* returned.
195207
*/
196208
@Mutation("updateNote")
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
package graphql.gitlab.model;
2+
3+
import java.util.Objects;
4+
5+
import org.eclipse.microprofile.graphql.Name;
6+
7+
/**
8+
* The currently authenticated GitLab user.
9+
*/
10+
@Name("CurrentUser")
11+
public class CurrentUser implements Todoable {
12+
13+
/**
14+
* Global ID of the user.
15+
*/
16+
private UserID id;
17+
18+
/**
19+
* To-do items of the user.
20+
*/
21+
private TodoConnection todos;
22+
23+
/**
24+
* Username of the user. Unique within the instance of GitLab.
25+
*/
26+
private String username;
27+
28+
public UserID getId() {
29+
return id;
30+
}
31+
32+
public CurrentUser setId(UserID id) {
33+
this.id = id;
34+
return this;
35+
}
36+
37+
public TodoConnection getTodos() {
38+
return todos;
39+
}
40+
41+
public CurrentUser setTodos(TodoConnection todos) {
42+
this.todos = todos;
43+
return this;
44+
}
45+
46+
public String getUsername() {
47+
return username;
48+
}
49+
50+
public CurrentUser setUsername(String username) {
51+
this.username = username;
52+
return this;
53+
}
54+
55+
@Override
56+
public int hashCode() {
57+
return Objects.hash(id, todos, username);
58+
}
59+
60+
@Override
61+
public boolean equals(Object obj) {
62+
if (this == obj)
63+
return true;
64+
if (obj == null)
65+
return false;
66+
if (getClass() != obj.getClass())
67+
return false;
68+
CurrentUser other = (CurrentUser) obj;
69+
return Objects.equals(id, other.id) && Objects.equals(todos, other.todos) && Objects.equals(username, other.username);
70+
}
71+
72+
@Override
73+
public String toString() {
74+
return "CurrentUser [id=" + id + ", todos=" + todos + ", username=" + username + "]";
75+
}
76+
77+
}

src/main/java/graphql/gitlab/model/Group.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import org.eclipse.microprofile.graphql.Name;
66

77
@Name("Group")
8-
public class Group {
8+
public class Group implements Todoable {
99

1010
/**
1111
* Full name of the namespace.

src/main/java/graphql/gitlab/model/GroupContainingEpicBoards.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import org.eclipse.microprofile.graphql.Name;
66

77
@Name("GroupContainingEpicBoards")
8-
public class GroupContainingEpicBoards {
8+
public class GroupContainingEpicBoards implements Todoable {
99

1010
/**
1111
* Find epic boards. Deprecated in GitLab 17.5: Replaced by WorkItem type.

src/main/java/graphql/gitlab/model/GroupContainingIssueBoards.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import org.eclipse.microprofile.graphql.Name;
66

77
@Name("GroupContainingIssueBoards")
8-
public class GroupContainingIssueBoards {
8+
public class GroupContainingIssueBoards implements Todoable {
99

1010
/**
1111
* Boards of the group.

src/main/java/graphql/gitlab/model/GroupContainingSingleEpicBoard.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import org.eclipse.microprofile.graphql.Name;
66

77
@Name("GroupContainingSingleEpicBoard")
8-
public class GroupContainingSingleEpicBoard {
8+
public class GroupContainingSingleEpicBoard implements Todoable {
99

1010
/**
1111
* Find a single epic board. Deprecated in GitLab 17.5: Replaced by WorkItem type.

src/main/java/graphql/gitlab/model/GroupContainingSingleIssueBoard.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import org.eclipse.microprofile.graphql.Name;
66

77
@Name("GroupContainingSingleIssueBoard")
8-
public class GroupContainingSingleIssueBoard {
8+
public class GroupContainingSingleIssueBoard implements Todoable {
99

1010
/**
1111
* A single board of the group.
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
package graphql.gitlab.model;
2+
3+
import java.util.Objects;
4+
5+
import org.eclipse.microprofile.graphql.Name;
6+
7+
@Name("GroupRef")
8+
public class GroupRef implements Todoable {
9+
10+
/**
11+
* Full name of the namespace.
12+
*/
13+
private String fullName;
14+
15+
/**
16+
* Full path of the namespace.
17+
*/
18+
private String fullPath;
19+
20+
/**
21+
* ID of the namespace.
22+
*/
23+
private String id;
24+
25+
/**
26+
* Name of the namespace.
27+
*/
28+
private String name;
29+
30+
/**
31+
* Web URL of the group.
32+
*/
33+
private String webUrl;
34+
35+
public String getFullName() {
36+
return fullName;
37+
}
38+
39+
public GroupRef setFullName(String fullName) {
40+
this.fullName = fullName;
41+
return this;
42+
}
43+
44+
public String getFullPath() {
45+
return fullPath;
46+
}
47+
48+
public GroupRef setFullPath(String fullPath) {
49+
this.fullPath = fullPath;
50+
return this;
51+
}
52+
53+
public String getId() {
54+
return id;
55+
}
56+
57+
public GroupRef setId(String id) {
58+
this.id = id;
59+
return this;
60+
}
61+
62+
public String getName() {
63+
return name;
64+
}
65+
66+
public GroupRef setName(String name) {
67+
this.name = name;
68+
return this;
69+
}
70+
71+
public String getWebUrl() {
72+
return webUrl;
73+
}
74+
75+
public GroupRef setWebUrl(String webUrl) {
76+
this.webUrl = webUrl;
77+
return this;
78+
}
79+
80+
@Override
81+
public int hashCode() {
82+
return Objects.hash(fullName, fullPath, id, name, webUrl);
83+
}
84+
85+
@Override
86+
public boolean equals(Object obj) {
87+
if (this == obj)
88+
return true;
89+
if (obj == null)
90+
return false;
91+
if (getClass() != obj.getClass())
92+
return false;
93+
GroupRef other = (GroupRef) obj;
94+
return Objects.equals(fullName, other.fullName) && Objects.equals(fullPath, other.fullPath) && Objects.equals(id, other.id) && Objects.equals(name, other.name) && Objects.equals(webUrl, other.webUrl);
95+
}
96+
97+
@Override
98+
public String toString() {
99+
return "GroupRef [fullName=" + fullName + ", fullPath=" + fullPath + ", id=" + id + ", name=" + name + ", webUrl=" + webUrl + "]";
100+
}
101+
102+
}

src/main/java/graphql/gitlab/model/IterationID.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/**
88
* A `IterationID` is a global ID. It is encoded as a string.
99
*
10-
* An example `IterationID` is: `"gid://gitlab/Iteration/1"`.
10+
* An example `IterationID` is: `"gid://gitlab/Iteration/1"`.<br>
1111
* The older format `"gid://gitlab/EEIteration/1"` was deprecated in 13.3.
1212
*/
1313
@Name("IterationID")

0 commit comments

Comments
 (0)