Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
java-gitlab-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
沈俊林
java-gitlab-api
Commits
b40a44e5
Commit
b40a44e5
authored
Sep 15, 2017
by
David "novalis" Turner
Committed by
Tim Olshansky
Sep 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge request approvals (#236)
parent
20526fb0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
176 additions
and
1 deletion
+176
-1
GitlabAPI.java
src/main/java/org/gitlab/api/GitlabAPI.java
+10
-0
GitlabApprovedBy.java
src/main/java/org/gitlab/api/models/GitlabApprovedBy.java
+19
-0
GitlabMergeRequestApprovals.java
...va/org/gitlab/api/models/GitlabMergeRequestApprovals.java
+146
-0
GitlabUser.java
src/main/java/org/gitlab/api/models/GitlabUser.java
+1
-1
No files found.
src/main/java/org/gitlab/api/GitlabAPI.java
View file @
b40a44e5
...
...
@@ -1077,6 +1077,16 @@ public class GitlabAPI {
return
retrieve
().
getAll
(
tailUrl
,
GitlabMergeRequest
[].
class
);
}
/**
* Get information about the approvals present and required for a merge request
* EE only.
*/
public
GitlabMergeRequestApprovals
getMergeRequestApprovals
(
GitlabMergeRequest
mr
)
throws
IOException
{
String
tailUrl
=
GitlabProject
.
URL
+
"/"
+
sanitizeProjectId
(
mr
.
getTargetProjectId
())
+
GitlabMergeRequest
.
URL
+
"/"
+
mr
.
getIid
()
+
GitlabMergeRequestApprovals
.
URL
;
return
retrieve
().
to
(
tailUrl
,
GitlabMergeRequestApprovals
.
class
);
}
/**
* Cherry picks a commit.
*
...
...
src/main/java/org/gitlab/api/models/GitlabApprovedBy.java
0 → 100644
View file @
b40a44e5
package
org
.
gitlab
.
api
.
models
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
/**
* Incomprehensibly, Gitlab packages "approved_by" in a wrapper which contains a user
* and nothing else.
*/
public
class
GitlabApprovedBy
{
private
GitlabUser
user
;
public
GitlabUser
getUser
()
{
return
user
;
}
public
void
setUser
(
GitlabUser
user
)
{
this
.
user
=
user
;
}
}
src/main/java/org/gitlab/api/models/GitlabMergeRequestApprovals.java
0 → 100644
View file @
b40a44e5
package
org
.
gitlab
.
api
.
models
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
public
class
GitlabMergeRequestApprovals
{
public
static
final
String
URL
=
"/approvals"
;
private
Integer
id
;
private
Integer
iid
;
@JsonProperty
(
"project_id"
)
private
Integer
projectId
;
private
String
title
;
private
String
description
;
private
String
state
;
@JsonProperty
(
"updated_at"
)
private
Date
updatedAt
;
@JsonProperty
(
"created_at"
)
private
Date
createdAt
;
@JsonProperty
(
"merge_status"
)
private
String
mergeStatus
;
@JsonProperty
(
"approvals_required"
)
private
Integer
approvalsRequired
;
@JsonProperty
(
"approvals_left"
)
private
Integer
approvalsLeft
;
@JsonProperty
(
"approved_by"
)
private
List
<
GitlabApprovedBy
>
approvedBy
;
@JsonProperty
(
"suggested_approvers"
)
private
List
<
GitlabUser
>
suggestedApprovers
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getIid
()
{
return
iid
;
}
public
void
setIid
(
Integer
iid
)
{
this
.
iid
=
iid
;
}
public
Integer
getProjectId
()
{
return
projectId
;
}
public
void
setProjectId
(
Integer
projectId
)
{
this
.
projectId
=
projectId
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
d
)
{
description
=
d
;
}
public
String
getState
()
{
return
state
;
}
public
void
setState
(
String
state
)
{
this
.
state
=
state
;
}
public
Date
getUpdatedAt
()
{
return
updatedAt
;
}
public
void
setUpdatedAt
(
Date
updatedAt
)
{
this
.
updatedAt
=
updatedAt
;
}
public
Date
getCreatedAt
()
{
return
createdAt
;
}
public
void
setCreatedAt
(
Date
createdAt
)
{
this
.
createdAt
=
createdAt
;
}
public
String
getMergeStatus
()
{
return
mergeStatus
;
}
public
void
setMergeStatus
(
String
mergeStatus
)
{
this
.
mergeStatus
=
mergeStatus
;
}
public
Integer
getApprovalsRequired
()
{
return
approvalsRequired
;
}
public
void
setApprovalsRequired
(
Integer
approvalsRequired
)
{
this
.
approvalsRequired
=
approvalsRequired
;
}
public
Integer
getApprovalsLeft
()
{
return
approvalsLeft
;
}
public
void
setApprovalsLeft
(
Integer
approvalsLeft
)
{
this
.
approvalsLeft
=
approvalsLeft
;
}
public
List
<
GitlabApprovedBy
>
getApprovedBy
()
{
return
approvedBy
;
}
public
void
setApprovedBy
(
List
<
GitlabApprovedBy
>
approvedBy
)
{
this
.
approvedBy
=
approvedBy
;
}
public
List
<
GitlabUser
>
getSuggestedApprovers
()
{
return
suggestedApprovers
;
}
public
void
setSuggestedApprovers
(
List
<
GitlabUser
>
suggestedApprovers
)
{
this
.
suggestedApprovers
=
suggestedApprovers
;
}
}
src/main/java/org/gitlab/api/models/GitlabUser.java
View file @
b40a44e5
...
...
@@ -22,7 +22,7 @@ public class GitlabUser {
private
String
_twitter
;
private
String
_provider
;
private
String
_state
;
private
b
oolean
_blocked
;
private
B
oolean
_blocked
;
private
List
<
GitlabUserIdentity
>
_identities
;
@JsonProperty
(
"private_token"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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