From 06f78e13add06cd4959f1724c824aa42ad79cce7 Mon Sep 17 00:00:00 2001 From: Jean-Michel Leclercq Date: Sun, 13 Oct 2024 07:02:58 +0200 Subject: [PATCH] Add properties in Issue Model Class #1145 (#1177) --------- Co-authored-by: Jeremie Bresson --- .../gitlab4j/api/models/AbstractIssue.java | 64 +++++++++++++++++-- .../api/models/AbstractMinimalEpic.java | 9 +++ .../org/gitlab4j/api/models/IssueEpic.java | 11 ++++ .../resources/org/gitlab4j/api/issue.json | 13 +++- 4 files changed, 91 insertions(+), 6 deletions(-) create mode 100644 src/main/java/org/gitlab4j/api/models/IssueEpic.java diff --git a/src/main/java/org/gitlab4j/api/models/AbstractIssue.java b/src/main/java/org/gitlab4j/api/models/AbstractIssue.java index ab096d03..c656192c 100644 --- a/src/main/java/org/gitlab4j/api/models/AbstractIssue.java +++ b/src/main/java/org/gitlab4j/api/models/AbstractIssue.java @@ -74,14 +74,20 @@ public String toString() { private Integer weight; private Boolean discussionLocked; private TimeStats timeStats; + private String severity; + private String issueType; + private IssueEpic epic; private Integer upvotes; private Integer downvotes; private Integer mergeRequestsCount; private Boolean hasTasks; private String taskStatus; + private Boolean imported; + private String importedFrom; private Iteration iteration; private TaskCompletionStatus taskCompletionStatus; + private String healthStatus; public Assignee getAssignee() { return assignee; @@ -328,13 +334,29 @@ public void setTaskStatus(String taskStatus) { this.taskStatus = taskStatus; } + public Boolean getImported() { + return imported; + } + + public void setImported(Boolean imported) { + this.imported = imported; + } + + public String getImportedFrom() { + return importedFrom; + } + + public void setImportedFrom(String importedFrom) { + this.importedFrom = importedFrom; + } + public Iteration getIteration() { - return iteration; - } + return iteration; + } - public void setIteration(Iteration iteration) { - this.iteration = iteration; - } + public void setIteration(Iteration iteration) { + this.iteration = iteration; + } public TaskCompletionStatus getTaskCompletionStatus() { return taskCompletionStatus; @@ -344,6 +366,38 @@ public void setTaskCompletionStatus(TaskCompletionStatus taskCompletionStatus) { this.taskCompletionStatus = taskCompletionStatus; } + public String getIssueType() { + return issueType; + } + + public void setIssueType(String issueType) { + this.issueType = issueType; + } + + public String getSeverity() { + return severity; + } + + public void setSeverity(String severity) { + this.severity = severity; + } + + public IssueEpic getEpic() { + return epic; + } + + public void setEpic(IssueEpic epic) { + this.epic = epic; + } + + public String getHealthStatus() { + return healthStatus; + } + + public void setHealthStatus(String healthStatus) { + this.healthStatus = healthStatus; + } + @Override public String toString() { return (JacksonJson.toJsonString(this)); diff --git a/src/main/java/org/gitlab4j/api/models/AbstractMinimalEpic.java b/src/main/java/org/gitlab4j/api/models/AbstractMinimalEpic.java index 8861058a..18e31b32 100644 --- a/src/main/java/org/gitlab4j/api/models/AbstractMinimalEpic.java +++ b/src/main/java/org/gitlab4j/api/models/AbstractMinimalEpic.java @@ -13,6 +13,7 @@ public class AbstractMinimalEpic> implements Se private Long parentId; private String title; private String reference; + private String url; public Long getId() { return id; @@ -68,6 +69,14 @@ public void setReference(String reference) { this.reference = reference; } + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + public String toString() { return (JacksonJson.toJsonString(this)); } diff --git a/src/main/java/org/gitlab4j/api/models/IssueEpic.java b/src/main/java/org/gitlab4j/api/models/IssueEpic.java new file mode 100644 index 00000000..f33506c7 --- /dev/null +++ b/src/main/java/org/gitlab4j/api/models/IssueEpic.java @@ -0,0 +1,11 @@ +package org.gitlab4j.api.models; + +import org.gitlab4j.api.utils.JacksonJson; + +public class IssueEpic extends AbstractMinimalEpic { + private static final long serialVersionUID = 1L; + + public String toString() { + return (JacksonJson.toJsonString(this)); + } +} diff --git a/src/test/resources/org/gitlab4j/api/issue.json b/src/test/resources/org/gitlab4j/api/issue.json index d3aaa0ca..51d44b77 100644 --- a/src/test/resources/org/gitlab4j/api/issue.json +++ b/src/test/resources/org/gitlab4j/api/issue.json @@ -40,6 +40,7 @@ "id" : 1, "name" : "Administrator" }, + "severity": "UNKNOWN", "subscribed": false, "user_notes_count": 1, "web_url": "http://example.com/example/example/issues/1", @@ -59,6 +60,15 @@ "count": 0, "completed_count": 0 }, + "imported": false, + "imported_from": "none", + "epic": { + "id": 1347, + "iid": 5, + "title": "Test Epic", + "url": "/groups/example/-/epics/5", + "group_id": 1651 + }, "iteration": { "id": 158, "iid": 34, @@ -72,5 +82,6 @@ "start_date": "2023-09-04T00:00:00Z", "due_date": "2023-09-10T00:00:00Z", "web_url": "http://example.com/example/-/iterations/158" - } + }, + "health_status": "needs_attention" } \ No newline at end of file