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
612cb968
Commit
612cb968
authored
Mar 14, 2016
by
Madhav Ponugoti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added createMergeRequest to API and also added merge_status to MergeRequest
parent
43272126
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
0 deletions
+36
-0
GitlabAPI.java
src/main/java/org/gitlab/api/GitlabAPI.java
+28
-0
GitlabMergeRequest.java
src/main/java/org/gitlab/api/models/GitlabMergeRequest.java
+8
-0
No files found.
src/main/java/org/gitlab/api/GitlabAPI.java
View file @
612cb968
...
@@ -814,6 +814,34 @@ public class GitlabAPI {
...
@@ -814,6 +814,34 @@ public class GitlabAPI {
return
retrieve
().
to
(
tailUrl
,
GitlabMergeRequest
.
class
);
return
retrieve
().
to
(
tailUrl
,
GitlabMergeRequest
.
class
);
}
}
/**
* Create a new MergeRequest
*
* @param projectId
* @param sourceBranch
* @param targetBranch
* @param assigneeId
* @param title
* @return GitlabMergeRequest
* @throws IOException on gitlab api call error
*/
public
GitlabMergeRequest
createMergeRequest
(
Serializable
projectId
,
String
sourceBranch
,
String
targetBranch
,
Integer
assigneeId
,
String
title
)
throws
IOException
{
Query
query
=
new
Query
()
.
appendIf
(
"target_branch"
,
targetBranch
)
.
appendIf
(
"source_branch"
,
sourceBranch
)
.
appendIf
(
"assignee_id"
,
assigneeId
)
.
appendIf
(
"title"
,
title
);
String
tailUrl
=
GitlabProject
.
URL
+
"/"
+
sanitizeProjectId
(
projectId
)
+
GitlabMergeRequest
.
URL
+
query
.
toString
();
return
dispatch
().
to
(
tailUrl
,
GitlabMergeRequest
.
class
);
}
/**
/**
* Updates a Merge Request
* Updates a Merge Request
*
*
...
...
src/main/java/org/gitlab/api/models/GitlabMergeRequest.java
View file @
612cb968
...
@@ -49,6 +49,10 @@ public class GitlabMergeRequest {
...
@@ -49,6 +49,10 @@ public class GitlabMergeRequest {
@JsonProperty
(
"created_at"
)
@JsonProperty
(
"created_at"
)
private
Date
createdAt
;
private
Date
createdAt
;
@JsonProperty
(
"merge_status"
)
private
String
mergeStatus
;
public
Integer
getId
()
{
public
Integer
getId
()
{
return
id
;
return
id
;
}
}
...
@@ -234,4 +238,8 @@ public class GitlabMergeRequest {
...
@@ -234,4 +238,8 @@ public class GitlabMergeRequest {
public
void
setChanges
(
List
<
GitlabCommitDiff
>
changes
)
{
public
void
setChanges
(
List
<
GitlabCommitDiff
>
changes
)
{
this
.
changes
=
changes
;
this
.
changes
=
changes
;
}
}
public
String
getMergeStatus
()
{
return
mergeStatus
;
}
public
void
setMergeStatus
(
String
mergeStatus
)
{
this
.
mergeStatus
=
mergeStatus
;
}
}
}
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