Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
73c78a15
Unverified
Commit
73c78a15
authored
Apr 26, 2023
by
Jérémie Bresson
Committed by
GitHub
Apr 26, 2023
Browse files
Add missing attributes on Epic (#961)
Fixes #887
parent
407166a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/models/Epic.java
View file @
73c78a15
...
@@ -2,22 +2,66 @@ package org.gitlab4j.api.models;
...
@@ -2,22 +2,66 @@ package org.gitlab4j.api.models;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
org.gitlab4j.api.utils.JacksonJsonEnumHelper
;
import
org.gitlab4j.api.utils.JacksonJson
;
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
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
id
;
private
Long
iid
;
private
Long
iid
;
private
Long
groupId
;
private
Long
groupId
;
private
Long
parentId
;
private
Long
parentIid
;
private
String
title
;
private
String
title
;
private
String
description
;
private
String
description
;
private
EpicState
state
;
private
String
webUrl
;
private
String
reference
;
private
References
references
;
private
Author
author
;
private
Author
author
;
private
List
<
String
>
labels
;
private
List
<
String
>
labels
;
private
Date
startDate
;
private
Date
startDate
;
private
Boolean
startDateIsFixed
;
private
Date
dueDate
;
private
Boolean
dueDateIsFixed
;
private
Date
dueDateFromInheritedSource
;
private
Date
endDate
;
private
Date
endDate
;
private
Date
createdAt
;
private
Date
createdAt
;
private
Date
updatedAt
;
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
()
{
public
Long
getId
()
{
return
id
;
return
id
;
...
@@ -43,6 +87,22 @@ public class Epic {
...
@@ -43,6 +87,22 @@ public class Epic {
this
.
groupId
=
groupId
;
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
()
{
public
String
getTitle
()
{
return
title
;
return
title
;
}
}
...
@@ -69,6 +129,38 @@ public class Epic {
...
@@ -69,6 +129,38 @@ public class Epic {
return
(
this
);
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
()
{
public
Author
getAuthor
()
{
return
author
;
return
author
;
}
}
...
@@ -108,6 +200,38 @@ public class Epic {
...
@@ -108,6 +200,38 @@ public class Epic {
return
(
this
);
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
()
{
public
Date
getEndDate
()
{
return
endDate
;
return
endDate
;
}
}
...
@@ -137,7 +261,63 @@ public class Epic {
...
@@ -137,7 +261,63 @@ public class Epic {
this
.
updatedAt
=
updatedAt
;
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
()
{
public
String
toString
()
{
return
(
JacksonJson
.
toJsonString
(
this
));
return
(
JacksonJson
.
toJsonString
(
this
));
}
}
...
...
src/test/resources/org/gitlab4j/api/epic.json
View file @
73c78a15
...
@@ -2,16 +2,42 @@
...
@@ -2,16 +2,42 @@
"id"
:
30
,
"id"
:
30
,
"iid"
:
5
,
"iid"
:
5
,
"group_id"
:
7
,
"group_id"
:
7
,
"parent_id"
:
3
,
"parent_iid"
:
8
,
"title"
:
"Ea cupiditate dolores ut vero consequatur quasi veniam voluptatem et non."
,
"title"
:
"Ea cupiditate dolores ut vero consequatur quasi veniam voluptatem et non."
,
"description"
:
"Molestias dolorem eos vitae expedita impedit necessitatibus quo voluptatum."
,
"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"
:{
"author"
:{
"id"
:
7
,
"id"
:
7
,
"name"
:
"Pamella Huel"
,
"name"
:
"Pamella Huel"
,
"username"
:
"arnita"
,
"username"
:
"arnita"
,
"state"
:
"active"
,
"state"
:
"active"
,
"avatar_url"
:
"http://www.gravatar.com/avatar/a2f5c6fcef64c9c69cb8779cb292be1b?s=80&d=identicon"
,
"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"
,
"start_date"
:
"2018-07-01T00:00:00Z"
,
"updated_at"
:
"2018-01-22T12:41:41.166Z"
"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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment