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
0476badc
Commit
0476badc
authored
Mar 19, 2020
by
Greg Messner
Browse files
Added support for assignees (#536)
parent
f9b398c7
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/webhook/EventMergeRequest.java
View file @
0476badc
package
org.gitlab4j.api.webhook
;
package
org.gitlab4j.api.webhook
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
org.gitlab4j.api.models.Assignee
;
import
org.gitlab4j.api.models.Assignee
;
...
@@ -58,6 +59,7 @@ public class EventMergeRequest {
...
@@ -58,6 +59,7 @@ public class EventMergeRequest {
private
Duration
humanTotalTimeSpent
;
private
Duration
humanTotalTimeSpent
;
private
Integer
timeEstimate
;
private
Integer
timeEstimate
;
private
Duration
humanTimeEstimate
;
private
Duration
humanTimeEstimate
;
private
List
<
Integer
>
assigneeIds
;
public
Integer
getAssigneeId
()
{
public
Integer
getAssigneeId
()
{
return
this
.
assigneeId
;
return
this
.
assigneeId
;
...
@@ -427,6 +429,14 @@ public class EventMergeRequest {
...
@@ -427,6 +429,14 @@ public class EventMergeRequest {
this
.
humanTimeEstimate
=
humanTimeEstimate
;
this
.
humanTimeEstimate
=
humanTimeEstimate
;
}
}
public
List
<
Integer
>
getAssigneeIds
()
{
return
assigneeIds
;
}
public
void
setAssigneeIds
(
List
<
Integer
>
assigneeIds
)
{
this
.
assigneeIds
=
assigneeIds
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
(
JacksonJson
.
toJsonString
(
this
));
return
(
JacksonJson
.
toJsonString
(
this
));
...
...
src/main/java/org/gitlab4j/api/webhook/MergeRequestEvent.java
View file @
0476badc
...
@@ -2,6 +2,7 @@ package org.gitlab4j.api.webhook;
...
@@ -2,6 +2,7 @@ package org.gitlab4j.api.webhook;
import
java.util.List
;
import
java.util.List
;
import
org.gitlab4j.api.models.Assignee
;
import
org.gitlab4j.api.models.User
;
import
org.gitlab4j.api.models.User
;
import
org.gitlab4j.api.utils.JacksonJson
;
import
org.gitlab4j.api.utils.JacksonJson
;
...
@@ -16,6 +17,7 @@ public class MergeRequestEvent extends AbstractEvent {
...
@@ -16,6 +17,7 @@ public class MergeRequestEvent extends AbstractEvent {
private
ObjectAttributes
objectAttributes
;
private
ObjectAttributes
objectAttributes
;
private
List
<
EventLabel
>
labels
;
private
List
<
EventLabel
>
labels
;
private
MergeRequestChanges
changes
;
private
MergeRequestChanges
changes
;
private
List
<
Assignee
>
assignees
;
public
String
getObjectKind
()
{
public
String
getObjectKind
()
{
return
(
OBJECT_KIND
);
return
(
OBJECT_KIND
);
...
@@ -74,6 +76,14 @@ public class MergeRequestEvent extends AbstractEvent {
...
@@ -74,6 +76,14 @@ public class MergeRequestEvent extends AbstractEvent {
this
.
changes
=
changes
;
this
.
changes
=
changes
;
}
}
public
List
<
Assignee
>
getAssignees
()
{
return
assignees
;
}
public
void
setAssignees
(
List
<
Assignee
>
assignees
)
{
this
.
assignees
=
assignees
;
}
public
static
class
ObjectAttributes
extends
EventMergeRequest
{
public
static
class
ObjectAttributes
extends
EventMergeRequest
{
}
}
...
...
src/test/resources/org/gitlab4j/api/merge-request-system-hook-event.json
View file @
0476badc
...
@@ -92,7 +92,12 @@
...
@@ -92,7 +92,12 @@
}
}
},
},
"work_in_progress"
:
false
,
"work_in_progress"
:
false
,
"total_time_spent"
:
0
"total_time_spent"
:
0
,
"human_total_time_spent"
:
"0m"
,
"human_time_estimate"
:
"1h"
,
"assignee_ids"
:
[
96
]
},
},
"labels"
:
[],
"labels"
:
[],
"repository"
:
{
"repository"
:
{
...
@@ -100,5 +105,12 @@
...
@@ -100,5 +105,12 @@
"url"
:
"git@example.com:awesome_space/awesome_project.git"
,
"url"
:
"git@example.com:awesome_space/awesome_project.git"
,
"description"
:
""
,
"description"
:
""
,
"homepage"
:
"http://example.com/awesome_space/awesome_project"
"homepage"
:
"http://example.com/awesome_space/awesome_project"
}
},
"assignees"
:
[
{
"name"
:
"User1"
,
"username"
:
"user1"
,
"avatar_url"
:
"http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=40
\u
0026d=identicon"
}
]
}
}
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