Unverified Commit 73c78a15 authored by Jérémie Bresson's avatar Jérémie Bresson Committed by GitHub
Browse files

Add missing attributes on Epic (#961)

Fixes #887
parent 407166a9
......@@ -2,22 +2,66 @@ package org.gitlab4j.api.models;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.gitlab4j.api.utils.JacksonJsonEnumHelper;
import org.gitlab4j.api.utils.JacksonJson;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
public class Epic {
public enum EpicState {
OPENED, CLOSED, ALL;
private static JacksonJsonEnumHelper<EpicState> enumHelper = new JacksonJsonEnumHelper<>(EpicState.class);
@JsonCreator
public static EpicState forValue(String value) {
return enumHelper.forValue(value);
}
@JsonValue
public String toValue() {
return (enumHelper.toString(this));
}
public String toString() {
return (enumHelper.toString(this));
}
}
private Long id;
private Long iid;
private Long groupId;
private Long parentId;
private Long parentIid;
private String title;
private String description;
private EpicState state;
private String webUrl;
private String reference;
private References references;
private Author author;
private List<String> labels;
private Date startDate;
private Boolean startDateIsFixed;
private Date dueDate;
private Boolean dueDateIsFixed;
private Date dueDateFromInheritedSource;
private Date endDate;
private Date createdAt;
private Date updatedAt;
private Date closedAt;
private Integer downvotes;
private Integer upvotes;
private String color;
private Boolean subscribed;
@JsonProperty("_links")
private Map<String, String> links;
public Long getId() {
return id;
......@@ -43,6 +87,22 @@ public class Epic {
this.groupId = groupId;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public Long getParentIid() {
return parentIid;
}
public void setParentIid(Long parentIid) {
this.parentIid = parentIid;
}
public String getTitle() {
return title;
}
......@@ -69,6 +129,38 @@ public class Epic {
return (this);
}
public EpicState getState() {
return state;
}
public void setState(EpicState state) {
this.state = state;
}
public String getWebUrl() {
return webUrl;
}
public void setWebUrl(String webUrl) {
this.webUrl = webUrl;
}
public String getReference() {
return reference;
}
public void setReference(String reference) {
this.reference = reference;
}
public References getReferences() {
return references;
}
public void setReferences(References references) {
this.references = references;
}
public Author getAuthor() {
return author;
}
......@@ -108,6 +200,38 @@ public class Epic {
return (this);
}
public Boolean getStartDateIsFixed() {
return startDateIsFixed;
}
public void setStartDateIsFixed(Boolean startDateIsFixed) {
this.startDateIsFixed = startDateIsFixed;
}
public Date getDueDate() {
return dueDate;
}
public void setDueDate(Date dueDate) {
this.dueDate = dueDate;
}
public Boolean getDueDateIsFixed() {
return dueDateIsFixed;
}
public void setDueDateIsFixed(Boolean dueDateIsFixed) {
this.dueDateIsFixed = dueDateIsFixed;
}
public Date getDueDateFromInheritedSource() {
return dueDateFromInheritedSource;
}
public void setDueDateFromInheritedSource(Date dueDateFromInheritedSource) {
this.dueDateFromInheritedSource = dueDateFromInheritedSource;
}
public Date getEndDate() {
return endDate;
}
......@@ -137,7 +261,63 @@ public class Epic {
this.updatedAt = updatedAt;
}
@Override
public Date getClosedAt() {
return closedAt;
}
public void setClosedAt(Date closedAt) {
this.closedAt = closedAt;
}
public Integer getDownvotes() {
return downvotes;
}
public void setDownvotes(Integer downvotes) {
this.downvotes = downvotes;
}
public Integer getUpvotes() {
return upvotes;
}
public void setUpvotes(Integer upvotes) {
this.upvotes = upvotes;
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public Boolean getSubscribed() {
return subscribed;
}
public void setSubscribed(Boolean subscribed) {
this.subscribed = subscribed;
}
public Map<String, String> getLinks() {
return links;
}
public void setLinks(Map<String, String> links) {
this.links = links;
}
@JsonIgnore
public String getLinkByName(String name) {
if (links == null || links.isEmpty()) {
return (null);
}
return (links.get(name));
}
public String toString() {
return (JacksonJson.toJsonString(this));
}
......
......@@ -2,16 +2,42 @@
"id": 30,
"iid": 5,
"group_id": 7,
"parent_id": 3,
"parent_iid": 8,
"title": "Ea cupiditate dolores ut vero consequatur quasi veniam voluptatem et non.",
"description": "Molestias dolorem eos vitae expedita impedit necessitatibus quo voluptatum.",
"state": "opened",
"web_url": "http://gitlab.example.com/groups/test/-/epics/5",
"reference": "&5",
"references": {
"short": "&5",
"relative": "&5",
"full": "test&5"
},
"author":{
"id": 7,
"name": "Pamella Huel",
"username": "arnita",
"state": "active",
"avatar_url": "http://www.gravatar.com/avatar/a2f5c6fcef64c9c69cb8779cb292be1b?s=80&d=identicon",
"web_url": "http://localhost:3001/arnita"
"web_url": "http://gitlab.example.com/arnita"
},
"created_at": "2018-01-21T06:21:13.165Z",
"updated_at": "2018-01-22T12:41:41.166Z"
"start_date": "2018-07-01T00:00:00Z",
"start_date_is_fixed": false,
"due_date": "2018-07-31T00:00:00Z",
"due_date_is_fixed": false,
"due_date_from_inherited_source": "2018-07-31T00:00:00Z",
"created_at": "2018-07-17T13:36:22.770Z",
"updated_at": "2018-07-18T12:22:05.239Z",
"closed_at": "2018-08-18T12:22:05.239Z",
"labels": [],
"upvotes": 4,
"downvotes": 0,
"color": "#1068bf",
"subscribed": true,
"_links":{
"self": "http://gitlab.example.com/api/v4/groups/7/epics/5",
"epic_issues": "http://gitlab.example.com/api/v4/groups/7/epics/5/issues",
"group":"http://gitlab.example.com/api/v4/groups/7"
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment