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
71efa977
Commit
71efa977
authored
Nov 30, 2014
by
timols
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated code conventions to not use _ variables, fixed whitespace, resolved backwards compat issues
parent
3dbfade8
Changes
24
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
1075 additions
and
1091 deletions
+1075
-1091
GitlabAPI.java
src/main/java/org/gitlab/api/GitlabAPI.java
+225
-239
GitlabHTTPRequestor.java
src/main/java/org/gitlab/api/http/GitlabHTTPRequestor.java
+74
-81
Query.java
src/main/java/org/gitlab/api/http/Query.java
+14
-18
GitlabAbstractMember.java
...main/java/org/gitlab/api/models/GitlabAbstractMember.java
+8
-8
GitlabAccessLevel.java
src/main/java/org/gitlab/api/models/GitlabAccessLevel.java
+4
-3
GitlabBranch.java
src/main/java/org/gitlab/api/models/GitlabBranch.java
+35
-35
GitlabBranchCommit.java
src/main/java/org/gitlab/api/models/GitlabBranchCommit.java
+22
-24
GitlabCommit.java
src/main/java/org/gitlab/api/models/GitlabCommit.java
+42
-41
GitlabCommitDiff.java
src/main/java/org/gitlab/api/models/GitlabCommitDiff.java
+24
-24
GitlabGroup.java
src/main/java/org/gitlab/api/models/GitlabGroup.java
+15
-15
GitlabIssue.java
src/main/java/org/gitlab/api/models/GitlabIssue.java
+129
-128
GitlabMergeRequest.java
src/main/java/org/gitlab/api/models/GitlabMergeRequest.java
+54
-45
GitlabMilestone.java
src/main/java/org/gitlab/api/models/GitlabMilestone.java
+93
-93
GitlabNamespace.java
src/main/java/org/gitlab/api/models/GitlabNamespace.java
+25
-24
GitlabNote.java
src/main/java/org/gitlab/api/models/GitlabNote.java
+17
-16
GitlabPermission.java
src/main/java/org/gitlab/api/models/GitlabPermission.java
+20
-0
GitlabPersmission.java
src/main/java/org/gitlab/api/models/GitlabPersmission.java
+0
-20
GitlabProject.java
src/main/java/org/gitlab/api/models/GitlabProject.java
+76
-76
GitlabProjectAccessLevel.java
.../java/org/gitlab/api/models/GitlabProjectAccessLevel.java
+25
-25
GitlabProjectHook.java
src/main/java/org/gitlab/api/models/GitlabProjectHook.java
+54
-56
GitlabSession.java
src/main/java/org/gitlab/api/models/GitlabSession.java
+12
-11
GitlabUser.java
src/main/java/org/gitlab/api/models/GitlabUser.java
+29
-28
GitlabAPIT.java
src/test/java/org/gitlab/api/GitlabAPIT.java
+68
-72
QueryTest.java
src/test/java/org/gitlab/api/http/QueryTest.java
+10
-9
No files found.
src/main/java/org/gitlab/api/GitlabAPI.java
View file @
71efa977
This diff is collapsed.
Click to expand it.
src/main/java/org/gitlab/api/http/GitlabHTTPRequestor.java
View file @
71efa977
This diff is collapsed.
Click to expand it.
src/main/java/org/gitlab/api/http/Query.java
View file @
71efa977
...
...
@@ -16,6 +16,7 @@ public class Query {
private
class
Tuple
<
T1
,
T2
>
{
T1
_1
;
T2
_2
;
public
Tuple
(
T1
_1
,
T2
_2
)
{
this
.
_1
=
_1
;
this
.
_2
=
_2
;
...
...
@@ -33,11 +34,10 @@ public class Query {
*
* @param name Parameter name
* @param value Parameter value
*
* @throws java.io.UnsupportedEncodingException If the provided value cannot be URL Encoded
*/
public
Query
append
(
final
String
name
,
final
String
value
)
throws
UnsupportedEncodingException
{
params
.
add
(
new
Tuple
(
name
,
new
Tuple
(
value
,
URLEncoder
.
encode
(
value
,
"UTF-8"
))));
params
.
add
(
new
Tuple
<
String
,
Tuple
<
String
,
String
>>(
name
,
new
Tuple
<
String
,
String
>
(
value
,
URLEncoder
.
encode
(
value
,
"UTF-8"
))));
return
this
;
}
...
...
@@ -47,11 +47,10 @@ public class Query {
*
* @param name Parameter name
* @param value Parameter value
*
* @throws java.io.UnsupportedEncodingException If the provided value cannot be URL Encoded
*/
public
Query
appendIf
(
final
String
name
,
final
String
value
)
throws
UnsupportedEncodingException
{
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
append
(
name
,
value
);
}
return
this
;
...
...
@@ -63,11 +62,10 @@ public class Query {
*
* @param name Parameter name
* @param value Parameter value
*
* @throws java.io.UnsupportedEncodingException If the provided value cannot be URL Encoded
*/
public
Query
appendIf
(
final
String
name
,
final
Integer
value
)
throws
UnsupportedEncodingException
{
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
append
(
name
,
value
.
toString
());
}
return
this
;
...
...
@@ -79,11 +77,10 @@ public class Query {
*
* @param name Parameter name
* @param value Parameter value
*
* @throws java.io.UnsupportedEncodingException If the provided value cannot be URL Encoded
*/
public
Query
appendIf
(
final
String
name
,
final
Boolean
value
)
throws
UnsupportedEncodingException
{
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
append
(
name
,
value
.
toString
());
}
return
this
;
...
...
@@ -95,11 +92,10 @@ public class Query {
*
* @param name Parameter name
* @param value Parameter value
*
* @throws java.io.UnsupportedEncodingException If the provided value cannot be URL Encoded
*/
public
Query
appendIf
(
final
String
name
,
final
GitlabAccessLevel
value
)
throws
UnsupportedEncodingException
{
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
append
(
name
,
Integer
.
toString
(
value
.
accessValue
));
}
return
this
;
...
...
@@ -113,8 +109,8 @@ public class Query {
public
String
toString
()
{
final
StringBuilder
builder
=
new
StringBuilder
();
for
(
final
Tuple
<
String
,
Tuple
<
String
,
String
>>
param
:
params
)
{
if
(
builder
.
length
()
==
0
)
{
for
(
final
Tuple
<
String
,
Tuple
<
String
,
String
>>
param
:
params
)
{
if
(
builder
.
length
()
==
0
)
{
builder
.
append
(
'?'
);
}
else
{
builder
.
append
(
'&'
);
...
...
src/main/java/org/gitlab/api/models/GitlabAbstractMember.java
View file @
71efa977
...
...
@@ -7,14 +7,14 @@ public abstract class GitlabAbstractMember extends GitlabUser {
public
static
final
String
URL
=
"/members"
;
@JsonProperty
(
"access_level"
)
private
int
_
accessLevel
;
private
int
accessLevel
;
public
GitlabAccessLevel
getAccessLevel
()
{
return
GitlabAccessLevel
.
fromAccessValue
(
_
accessLevel
);
return
GitlabAccessLevel
.
fromAccessValue
(
accessLevel
);
}
public
void
setAccessLevel
(
GitlabAccessLevel
accessLevel
)
{
_
accessLevel
=
accessLevel
.
accessValue
;
this
.
accessLevel
=
accessLevel
.
accessValue
;
}
}
src/main/java/org/gitlab/api/models/GitlabAccessLevel.java
View file @
71efa977
...
...
@@ -9,13 +9,14 @@ public enum GitlabAccessLevel {
Owner
(
50
);
public
final
int
accessValue
;
GitlabAccessLevel
(
int
accessValue
)
{
this
.
accessValue
=
accessValue
;
}
public
static
GitlabAccessLevel
fromAccessValue
(
final
int
accessValue
)
throws
IllegalArgumentException
{
for
(
final
GitlabAccessLevel
gitlabAccessLevel
:
GitlabAccessLevel
.
values
())
{
if
(
gitlabAccessLevel
.
accessValue
==
accessValue
)
{
for
(
final
GitlabAccessLevel
gitlabAccessLevel
:
GitlabAccessLevel
.
values
())
{
if
(
gitlabAccessLevel
.
accessValue
==
accessValue
)
{
return
gitlabAccessLevel
;
}
}
...
...
src/main/java/org/gitlab/api/models/GitlabBranch.java
View file @
71efa977
...
...
@@ -6,35 +6,35 @@ public class GitlabBranch {
public
final
static
String
URL
=
"/repository/branches/"
;
@JsonProperty
(
"name"
)
private
String
_
name
;
private
String
name
;
@JsonProperty
(
"commit"
)
private
GitlabBranchCommit
_
commit
;
private
GitlabBranchCommit
commit
;
@JsonProperty
(
"protected"
)
private
boolean
_p
rotected
;
private
boolean
branchP
rotected
;
public
String
getName
()
{
return
_
name
;
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
_
name
=
name
;
this
.
name
=
name
;
}
public
GitlabBranchCommit
getCommit
()
{
return
_
commit
;
return
commit
;
}
public
void
setCommit
(
GitlabBranchCommit
commit
)
{
this
.
_
commit
=
commit
;
this
.
commit
=
commit
;
}
public
boolean
isProtected
()
{
return
_p
rotected
;
return
branchP
rotected
;
}
public
void
setProtected
(
boolean
isProtected
)
{
this
.
_p
rotected
=
isProtected
;
this
.
branchP
rotected
=
isProtected
;
}
}
src/main/java/org/gitlab/api/models/GitlabBranchCommit.java
View file @
71efa977
package
org
.
gitlab
.
api
.
models
;
import
org.
gitlab.api.models.GitlabUser
;
import
org.
codehaus.jackson.annotate.JsonProperty
;
import
java.lang.String
;
import
java.util.Date
;
import
org.codehaus.jackson.annotate.JsonProperty
;
public
class
GitlabBranchCommit
{
public
static
String
URL
=
"/users"
;
private
String
_
id
;
private
String
_
tree
;
private
String
_
message
;
private
GitlabUser
_
author
;
private
GitlabUser
_
committer
;
private
String
id
;
private
String
tree
;
private
String
message
;
private
GitlabUser
author
;
private
GitlabUser
committer
;
@JsonProperty
(
"authored_date"
)
private
Date
_
authoredDate
;
private
Date
authoredDate
;
@JsonProperty
(
"committed_date"
)
private
Date
_
committedDate
;
private
Date
committedDate
;
public
String
getId
()
{
return
_
id
;
return
id
;
}
public
void
setId
(
String
id
)
{
_
id
=
id
;
this
.
id
=
id
;
}
public
String
getTree
()
{
return
_
tree
;
return
tree
;
}
public
void
setTree
(
String
tree
)
{
_
tree
=
tree
;
this
.
tree
=
tree
;
}
public
String
getMessage
()
{
return
_
message
;
return
message
;
}
public
void
setMessage
(
String
message
)
{
_
message
=
message
;
this
.
message
=
message
;
}
public
GitlabUser
getAuthor
()
{
return
_
author
;
return
author
;
}
public
void
setAuthor
(
GitlabUser
author
)
{
_
author
=
author
;
this
.
author
=
author
;
}
public
GitlabUser
getCommitter
()
{
return
_
committer
;
return
committer
;
}
public
void
setCommitter
(
GitlabUser
committer
)
{
_
committer
=
committer
;
this
.
committer
=
committer
;
}
public
Date
getAuthoredDate
()
{
return
_
authoredDate
;
return
authoredDate
;
}
public
void
setAuthoredDate
(
Date
authoredDate
)
{
_
authoredDate
=
authoredDate
;
this
.
authoredDate
=
authoredDate
;
}
public
Date
getCommittedDate
()
{
return
_
committedDate
;
return
committedDate
;
}
public
void
setCommittedDate
(
Date
committedDate
)
{
_
committedDate
=
committedDate
;
this
.
committedDate
=
committedDate
;
}
}
src/main/java/org/gitlab/api/models/GitlabCommit.java
View file @
71efa977
package
org
.
gitlab
.
api
.
models
;
import
org.codehaus.jackson.annotate.JsonProperty
;
import
java.util.Date
;
import
java.util.List
;
import
org.codehaus.jackson.annotate.JsonProperty
;
public
class
GitlabCommit
{
public
final
static
String
URL
=
"/commits"
;
private
String
_
id
;
private
String
_
title
;
private
String
_
description
;
private
String
id
;
private
String
title
;
private
String
description
;
@JsonProperty
(
"short_id"
)
private
String
_
shortId
;
private
String
shortId
;
@JsonProperty
(
"author_name"
)
private
String
_
authorName
;
private
String
authorName
;
@JsonProperty
(
"author_email"
)
private
String
_
authorEmail
;
private
String
authorEmail
;
@JsonProperty
(
"created_at"
)
private
Date
_
createdAt
;
private
Date
createdAt
;
@JsonProperty
(
"committed_date"
)
private
Date
_
committedDate
;
private
Date
committedDate
;
@JsonProperty
(
"authored_date"
)
private
Date
_
authoredDate
;
private
Date
authoredDate
;
@JsonProperty
(
"parent_ids"
)
private
List
<
String
>
_
parentIds
;
private
List
<
String
>
parentIds
;
public
String
getId
()
{
return
_
id
;
return
id
;
}
public
void
setId
(
String
id
)
{
_
id
=
id
;
this
.
id
=
id
;
}
public
String
getShortId
()
{
return
_
shortId
;
return
shortId
;
}
public
void
setShortId
(
String
shortId
)
{
_
shortId
=
shortId
;
this
.
shortId
=
shortId
;
}
public
String
getTitle
()
{
return
_
title
;
return
title
;
}
public
void
setTitle
(
String
title
)
{
_
title
=
title
;
this
.
title
=
title
;
}
public
String
getDescription
()
{
return
_
description
;
return
description
;
}
public
void
setDescription
(
String
description
)
{
_
description
=
description
;
this
.
description
=
description
;
}
public
String
getAuthorName
()
{
return
_
authorName
;
return
authorName
;
}
public
void
setAuthorName
(
String
authorName
)
{
_
authorName
=
authorName
;
this
.
authorName
=
authorName
;
}
public
String
getAuthorEmail
()
{
return
_
authorEmail
;
return
authorEmail
;
}
public
void
setAuthorEmail
(
String
authorEmail
)
{
_
authorEmail
=
authorEmail
;
this
.
authorEmail
=
authorEmail
;
}
public
Date
getCreatedAt
()
{
return
_
createdAt
;
return
createdAt
;
}
public
void
setCreatedAt
(
Date
createdAt
)
{
_
createdAt
=
createdAt
;
this
.
createdAt
=
createdAt
;
}
public
List
<
String
>
getParentIds
()
{
return
_
parentIds
;
return
parentIds
;
}
public
void
setParentIds
(
List
<
String
>
parentIds
)
{
_
parentIds
=
parentIds
;
this
.
parentIds
=
parentIds
;
}
@Override
...
...
src/main/java/org/gitlab/api/models/GitlabCommitDiff.java
View file @
71efa977
...
...
@@ -7,90 +7,90 @@ public class GitlabCommitDiff {
public
final
static
String
URL
=
"/diff"
;
@JsonProperty
(
"diff"
)
private
String
_
diff
;
private
String
diff
;
@JsonProperty
(
"new_path"
)
private
String
_
newPath
;
private
String
newPath
;
@JsonProperty
(
"old_path"
)
private
String
_
oldPath
;
private
String
oldPath
;
@JsonProperty
(
"a_mode"
)
private
String
_
aMode
;
private
String
aMode
;
@JsonProperty
(
"b_mode"
)
private
String
_
bMode
;
private
String
bMode
;
@JsonProperty
(
"new_file"
)
private
boolean
_
newFile
;
private
boolean
newFile
;
@JsonProperty
(
"renamed_file"
)
private
boolean
_
renamedFile
;
private
boolean
renamedFile
;
@JsonProperty
(
"deleted_file"
)
private
boolean
_
deletedFile
;
private
boolean
deletedFile
;
public
String
getDiff
()
{
return
_
diff
;
return
diff
;
}
public
void
setDiff
(
String
diff
)
{
_
diff
=
diff
;
this
.
diff
=
diff
;
}
public
String
getNewPath
()
{
return
_
newPath
;
return
newPath
;
}
public
void
setNewPath
(
String
newPath
)
{
_
newPath
=
newPath
;
this
.
newPath
=
newPath
;
}
public
String
getOldPath
()
{
return
_
oldPath
;
return
oldPath
;
}
public
void
setOldPath
(
String
oldPath
)
{
_
oldPath
=
oldPath
;
this
.
oldPath
=
oldPath
;
}
public
String
getAMode
()
{
return
_
aMode
;
return
aMode
;
}
public
void
setAMode
(
String
aMode
)
{
_
aMode
=
aMode
;
this
.
aMode
=
aMode
;
}
public
String
getBMode
()
{
return
_
bMode
;
return
bMode
;
}
public
void
setBMode
(
String
bMode
)
{
_
bMode
=
bMode
;
this
.
bMode
=
bMode
;
}
public
boolean
getNewFile
()
{
return
_
newFile
;
return
newFile
;
}
public
void
setNewFile
(
boolean
newFile
)
{
_
newFile
=
newFile
;
this
.
newFile
=
newFile
;
}
public
boolean
getRenamedFile
()
{
return
_
renamedFile
;
return
renamedFile
;
}
public
void
setRenamedFile
(
boolean
renamedFile
)
{
_
renamedFile
=
renamedFile
;
this
.
renamedFile
=
renamedFile
;
}
public
boolean
getDeletedFile
()
{
return
_
deletedFile
;
return
deletedFile
;
}
public
void
setDeletedFile
(
boolean
deletedFile
)
{
_
deletedFile
=
deletedFile
;
this
.
deletedFile
=
deletedFile
;
}
}
src/main/java/org/gitlab/api/models/GitlabGroup.java
View file @
71efa977
...
...
@@ -6,53 +6,53 @@ public class GitlabGroup {
public
static
final
String
URL
=
"/groups"
;
private
Integer
_
id
;
private
String
_
name
;
private
String
_
path
;
private
Integer
id
;
private
String
name
;
private
String
path
;
@JsonProperty
(
"ldap_cn"
)
private
String
_
ldapCn
;
private
String
ldapCn
;
@JsonProperty
(
"ldap_access"
)
private
Integer
_
ldapAccess
;
private
Integer
ldapAccess
;
public
Integer
getId
()
{
return
_
id
;
return
id
;
}
public
void
setId
(
Integer
id
)
{
_
id
=
id
;
this
.
id
=
id
;
}
public
String
getName
()
{
return
_
name
;
return
name
;
}
public
void
setName
(
String
name
)
{
_
name
=
name
;
this
.
name
=
name
;
}
public
String
getPath
()
{
return
_
path
;
return
path
;
}
public
void
setPath
(
String
path
)
{
_
path
=
path
;
this
.
path
=
path
;
}
public
String
getLdapCn
()
{
return
_
ldapCn
;
return
ldapCn
;
}
public
void
setLdapCn
(
String
ldapCn
)
{
this
.
_
ldapCn
=
ldapCn
;
this
.
ldapCn
=
ldapCn
;
}
public
GitlabAccessLevel
getLdapAccess
()
{
return
GitlabAccessLevel
.
fromAccessValue
(
_
ldapAccess
);
return
GitlabAccessLevel
.
fromAccessValue
(
ldapAccess
);
}
public
void
setLdapAccess
(
GitlabAccessLevel
ldapGitlabAccessLevel
)
{
this
.
_
ldapAccess
=
ldapGitlabAccessLevel
.
accessValue
;
this
.
ldapAccess
=
ldapGitlabAccessLevel
.
accessValue
;
}
}
src/main/java/org/gitlab/api/models/GitlabIssue.java
View file @
71efa977
package
org
.
gitlab
.
api
.
models
;
import
java.util.Date
;
import
org.codehaus.jackson.annotate.JsonProperty
;
import
java.util.Date
;
public
class
GitlabIssue
{
public
enum
Action
{
LEAVE
,
CLOSE
,
REOPEN
}
public
static
final
String
StateClosed
=
"closed"
;
public
static
final
String
StateOpened
=
"opened"
;
public
static
final
String
STATE_CLOSED
=
"closed"
;
public
static
final
String
STATE_OPENED
=
"opened"
;
public
static
final
String
URL
=
"/issues"
;
private
int
_
id
;
private
int
_
iid
;
private
int
id
;
private
int
iid
;
@JsonProperty
(
"project_id"
)
private
int
_
projectId
;
private
int
projectId
;
private
String
_
title
;
private
String
_
description
;
private
String
[]
_
labels
;
private
GitlabMilestone
_
milestone
;
private
String
title
;
private
String
description
;
private
String
[]
labels
;
private
GitlabMilestone
milestone
;
private
GitlabUser
_
assignee
;
private
GitlabUser
_
author
;
private
GitlabUser
assignee
;
private
GitlabUser
author
;
private
String
_
state
;
private
String
state
;
@JsonProperty
(
"updated_at"
)
private
Date
_
updatedAt
;
private
Date
updatedAt
;
@JsonProperty
(
"created_at"
)
private
Date
_
createdAt
;
private
Date
createdAt
;
public
int
getId
()
{
return
_
id
;
return
id
;
}
public
void
setId
(
int
id
)
{
_
id
=
id
;
this
.
id
=
id
;
}
public
int
getIid
()
{
return
_
iid
;
return
iid
;
}
public
void
setIid
(
int
iid
)
{
_
iid
=
iid
;
this
.
iid
=
iid
;
}
public
int
getProjectId
()
{
return
_
projectId
;
return
projectId
;
}
public
void
setProjectId
(
int
projectId
)
{
_
projectId
=
projectId
;
this
.
projectId
=
projectId
;
}
public
String
getTitle
()
{
return
_
title
;
return
title
;
}
public
void
setTitle
(
String
title
)
{
_
title
=
title
;
this
.
title
=
title
;
}
public
String
getDescription
()
{
return
_
description
;
return
description
;
}
public
void
setDescription
(
String
description
)
{
_
description
=
description
;
this
.
description
=
description
;
}
public
String
[]
getLabels
()
{
return
_
labels
;
return
labels
;
}
public
void
setLabels
(
String
[]
labels
)
{
_
labels
=
labels
;
this
.
labels
=
labels
;
}
public
GitlabMilestone
getMilestone
()
{
return
_
milestone
;
return
milestone
;
}
public
void
setMilestone
(
GitlabMilestone
milestone
)
{
_
milestone
=
milestone
;
this
.
milestone
=
milestone
;
}
public
GitlabUser
getAssignee
()
{
return
_
assignee
;
return
assignee
;
}
public
void
setAssignee
(
GitlabUser
assignee
)
{
_
assignee
=
assignee
;
this
.
assignee
=
assignee
;
}
public
GitlabUser
getAuthor
()
{
return
_
author
;
return
author
;
}
public
void
setAuthor
(
GitlabUser
author
)
{
_
author
=
author
;
this
.
author
=
author
;
}
public
String
getState
()
{
return
_
state
;
return
state
;
}
public
void
setState
(
String
state
)
{
_
state
=
state
;
this
.
state
=
state
;
}
public
Date
getUpdatedAt
()
{
return
_
updatedAt
;
return
updatedAt
;
}
public
void
setUpdatedAt
(
Date
updatedAt
)
{
_
updatedAt
=
updatedAt
;
this
.
updatedAt
=
updatedAt
;
}
public
Date
getCreatedAt
()
{
return
_
createdAt
;
return
createdAt
;
}
public
void
setCreatedAt
(
Date
createdAt
)
{
_
createdAt
=
createdAt
;
this
.
createdAt
=
createdAt
;
}
}
src/main/java/org/gitlab/api/models/GitlabMergeRequest.java
View file @
71efa977
...
...
@@ -5,136 +5,145 @@ import org.codehaus.jackson.annotate.JsonProperty;
public
class
GitlabMergeRequest
{
public
static
final
String
URL
=
"/merge_requests"
;
private
Integer
_
id
;
private
Integer
_
iid
;
private
String
_
title
;
private
String
_
state
;
private
String
_
description
;
private
boolean
_
closed
;
private
boolean
_
merged
;
private
GitlabUser
_
author
;
private
GitlabUser
_
assignee
;
private
Integer
id
;
private
Integer
iid
;
private
String
title
;
private
String
state
;
private
String
description
;
private
boolean
closed
;
private
boolean
merged
;
private
GitlabUser
author
;
private
GitlabUser
assignee
;
@JsonProperty
(
"target_branch"
)
private
String
_
targetBranch
;
private
String
targetBranch
;
@JsonProperty
(
"source_branch"
)
private
String
_
sourceBranch
;
private
String
sourceBranch
;
@JsonProperty
(
"project_id"
)
private
Integer
_
projectId
;
private
Integer
projectId
;
@JsonProperty
(
"source_project_id"
)
private
Integer
_
sourceProjectId
;
private
Integer
sourceProjectId
;
@JsonProperty
(
"milestone_id"
)
private
Integer
_milestone_i
d
;
private
Integer
milestoneI
d
;
public
Integer
getId
()
{
return
_
id
;
return
id
;
}
public
void
setId
(
Integer
id
)
{
_
id
=
id
;
this
.
id
=
id
;
}
public
Integer
getMilestoneId
(){
return
_milestone_id
;
}
public
void
setMilestoneId
(
Integer
id
)
{
_milestone_id
=
id
;
}
public
Integer
getMilestoneId
()
{
return
milestoneId
;
}
public
void
setMilestoneId
(
Integer
id
)
{
milestoneId
=
id
;
}
public
Integer
getIid
()
{
return
_
iid
;
return
iid
;
}
public
void
setIid
(
Integer
iid
)
{
_
iid
=
iid
;
this
.
iid
=
iid
;
}
public
String
getTargetBranch
()
{
return
_
targetBranch
;
return
targetBranch
;
}
public
void
setTargetBranch
(
String
targetBranch
)
{
_
targetBranch
=
targetBranch
;
this
.
targetBranch
=
targetBranch
;
}
public
String
getSourceBranch
()
{
return
_
sourceBranch
;
return
sourceBranch
;
}
public
void
setSourceBranch
(
String
sourceBranch
)
{
_
sourceBranch
=
sourceBranch
;
this
.
sourceBranch
=
sourceBranch
;
}
public
Integer
getProjectId
()
{
return
_
projectId
;
return
projectId
;
}
public
void
setProjectId
(
Integer
projectId
)
{
_
projectId
=
projectId
;
this
.
projectId
=
projectId
;
}
public
Integer
getSourceProjectId
()
{
return
_
sourceProjectId
;
return
sourceProjectId
;
}
public
void
setSourceProjectId
(
Integer
sourceProjectId
)
{
_
sourceProjectId
=
sourceProjectId
;
this
.
sourceProjectId
=
sourceProjectId
;
}
public
String
getTitle
()
{
return
_
title
;
return
title
;
}
public
void
setTitle
(
String
title
)
{
_
title
=
title
;
this
.
title
=
title
;
}
public
String
getDescription
()
{
return
_description
;
}
public
String
getDescription
()
{
return
description
;
}
public
void
setDescription
(
String
d
)
{
_description
=
d
;
}
public
void
setDescription
(
String
d
)
{
description
=
d
;
}
public
boolean
isClosed
()
{
return
_
closed
;
return
closed
;
}
public
void
setClosed
(
boolean
closed
)
{
_
closed
=
closed
;
this
.
closed
=
closed
;
}
public
boolean
isMerged
()
{
return
_
merged
;
return
merged
;
}
public
void
setMerged
(
boolean
merged
)
{
_
merged
=
merged
;
this
.
merged
=
merged
;
}
public
GitlabUser
getAuthor
()
{
return
_
author
;
return
author
;
}
public
void
setAuthor
(
GitlabUser
author
)
{
_
author
=
author
;
this
.
author
=
author
;
}
public
GitlabUser
getAssignee
()
{
return
_
assignee
;
return
assignee
;
}
public
void
setAssignee
(
GitlabUser
assignee
)
{
_
assignee
=
assignee
;
this
.
assignee
=
assignee
;
}
public
String
getState
()
{
return
_
state
;
return
state
;
}
public
void
setState
(
String
state
)
{
_
state
=
state
;
if
(
state
!=
null
)
{
_
closed
=
state
.
equals
(
"closed"
);
_
merged
=
state
.
equals
(
"merged"
);
this
.
state
=
state
;
if
(
state
!=
null
)
{
closed
=
state
.
equals
(
"closed"
);
merged
=
state
.
equals
(
"merged"
);
}
}
}
src/main/java/org/gitlab/api/models/GitlabMilestone.java
View file @
71efa977
package
org
.
gitlab
.
api
.
models
;
import
java.util.Date
;
import
org.codehaus.jackson.annotate.JsonProperty
;
import
java.util.Date
;
public
class
GitlabMilestone
{
public
static
final
String
URL
=
"/milestones"
;
private
int
_
id
;
private
int
_
iid
;
private
int
_
projectId
;
private
String
_
title
;
private
String
_
description
;
private
int
id
;
private
int
iid
;
private
int
projectId
;
private
String
title
;
private
String
description
;
@JsonProperty
(
"due_date"
)
private
Date
_
dueDate
;
private
Date
dueDate
;
private
String
_
state
;
private
String
state
;
@JsonProperty
(
"updated_date"
)
private
Date
_
updatedDate
;
private
Date
updatedDate
;
@JsonProperty
(
"created_date"
)
private
Date
_
createdDate
;
private
Date
createdDate
;
public
int
getId
()
{
return
_
id
;
return
id
;
}
public
void
setId
(
int
id
)
{
_
id
=
id
;
this
.
id
=
id
;
}
public
int
getIid
()
{
return
_
iid
;
return
iid
;
}
public
void
setIid
(
int
iid
)
{
_
iid
=
iid
;
this
.
iid
=
iid
;
}
public
int
getProjectId
()
{
return
_
projectId
;
return
projectId
;
}
public
void
setProjectId
(
int
projectId
)
{
_
projectId
=
projectId
;
this
.
projectId
=
projectId
;
}
public
String
getTitle
()
{
return
_
title
;
return
title
;
}
public
void
setTitle
(
String
title
)
{
_
title
=
title
;
this
.
title
=
title
;
}
public
String
getDescription
()
{
return
_
description
;
return
description
;
}
public
void
setDescription
(
String
description
)
{
_
description
=
description
;
this
.
description
=
description
;
}
public
Date
getDueDate
()
{
return
_
dueDate
;
return
dueDate
;
}
public
void
setDueDate
(
Date
dueDate
)
{
_
dueDate
=
dueDate
;
this
.
dueDate
=
dueDate
;
}
public
String
getState
()
{
return
_
state
;
return
state
;
}
public
void
setState
(
String
state
)
{
_
state
=
state
;
this
.
state
=
state
;
}
public
Date
getUpdatedDate
()
{
return
_
updatedDate
;
return
updatedDate
;
}
public
void
setUpdatedDate
(
Date
updatedDate
)
{
_
updatedDate
=
updatedDate
;
this
.
updatedDate
=
updatedDate
;
}
public
Date
getCreatedDate
()
{
return
_
createdDate
;
return
createdDate
;
}
public
void
setCreatedDate
(
Date
createdDate
)
{
_
createdDate
=
createdDate
;
this
.
createdDate
=
createdDate
;
}
}
src/main/java/org/gitlab/api/models/GitlabNamespace.java
View file @
71efa977
package
org
.
gitlab
.
api
.
models
;
import
java.util.Date
;
import
org.codehaus.jackson.annotate.JsonProperty
;
import
java.util.Date
;
public
class
GitlabNamespace
{
public
static
final
String
URL
=
"/groups"
;
private
Integer
_
id
;
private
String
_
name
;
private
String
_
path
;
private
String
_
description
;
private
Integer
id
;
private
String
name
;
private
String
path
;
private
String
description
;
@JsonProperty
(
"created_at"
)
private
Date
_
createdAt
;
private
Date
createdAt
;
@JsonProperty
(
"updated_at"
)
private
Date
_
updatedAt
;
private
Date
updatedAt
;
@JsonProperty
(
"owner_id"
)
private
Integer
_
ownerId
;
private
Integer
ownerId
;
public
Integer
getId
()
{
return
_
id
;
return
id
;
}
public
void
setId
(
Integer
id
)
{
_
id
=
id
;
this
.
id
=
id
;
}
public
Date
getCreatedAt
()
{
return
_
createdAt
;
return
createdAt
;
}
public
void
setCreatedAt
(
Date
createdAt
)
{
_
createdAt
=
createdAt
;
this
.
createdAt
=
createdAt
;
}
public
Date
getUpdatedAt
()
{
return
_
updatedAt
;
return
updatedAt
;
}
public
void
setUpdatedAt
(
Date
updatedAt
)
{
_
updatedAt
=
updatedAt
;
this
.
updatedAt
=
updatedAt
;
}
public
Integer
getOwnerId
()
{
return
_
ownerId
;
return
ownerId
;
}
public
void
setOwnerId
(
Integer
ownerId
)
{
_
ownerId
=
ownerId
;
this
.
ownerId
=
ownerId
;
}
public
String
getName
()
{
return
_
name
;
return
name
;
}
public
void
setName
(
String
name
)
{
_
name
=
name
;
this
.
name
=
name
;
}
public
String
getPath
()
{
return
_
path
;
return
path
;
}
public
void
setPath
(
String
path
)
{
_
path
=
path
;
this
.
path
=
path
;
}
public
String
getDescription
()
{
return
_
description
;
return
description
;
}
public
void
setDescription
(
String
description
)
{
_
description
=
description
;
this
.
description
=
description
;
}
}
src/main/java/org/gitlab/api/models/GitlabNote.java
View file @
71efa977
package
org
.
gitlab
.
api
.
models
;
import
java.util.Date
;
import
org.codehaus.jackson.annotate.JsonProperty
;
import
java.util.Date
;
public
class
GitlabNote
{
public
static
final
String
URL
=
"/notes"
;
private
Integer
_
id
;
private
String
_
body
;
private
String
_
attachment
;
private
GitlabUser
_
author
;
private
Integer
id
;
private
String
body
;
private
String
attachment
;
private
GitlabUser
author
;
@JsonProperty
(
"created_at"
)
private
Date
_
createdAt
;
private
Date
createdAt
;
public
Integer
getId
()
{
return
_
id
;
return
id
;
}
public
void
setId
(
Integer
id
)
{
_
id
=
id
;
this
.
id
=
id
;
}
public
String
getBody
()
{
return
_
body
;
return
body
;
}
public
void
setBody
(
String
body
)
{
_
body
=
body
;
this
.
body
=
body
;
}
public
GitlabUser
getAuthor
()
{
return
_
author
;
return
author
;
}
public
void
setAuthor
(
GitlabUser
author
)
{
_
author
=
author
;
this
.
author
=
author
;
}
public
Date
getCreatedAt
()
{
return
_
createdAt
;
return
createdAt
;
}
public
void
setCreatedAt
(
Date
createdAt
)
{
_
createdAt
=
createdAt
;
this
.
createdAt
=
createdAt
;
}
public
String
getAttachment
()
{
return
_
attachment
;
return
attachment
;
}
public
void
setAttachment
(
String
attachment
)
{
_
attachment
=
attachment
;
this
.
attachment
=
attachment
;
}
}
src/main/java/org/gitlab/api/models/GitlabPermission.java
0 → 100644
View file @
71efa977
package
org
.
gitlab
.
api
.
models
;
import
org.codehaus.jackson.annotate.JsonProperty
;
public
class
GitlabPermission
{
@JsonProperty
(
"project_access"
)
private
GitlabProjectAccessLevel
projectAccess
;
@JsonProperty
(
"group_access"
)
private
GitlabProjectAccessLevel
groupAccess
;
public
GitlabProjectAccessLevel
getProjectAccess
()
{
return
projectAccess
;
}
public
GitlabProjectAccessLevel
getProjectGroupAccess
()
{
return
groupAccess
;
}
}
src/main/java/org/gitlab/api/models/GitlabPersmission.java
deleted
100644 → 0
View file @
3dbfade8
package
org
.
gitlab
.
api
.
models
;
import
org.codehaus.jackson.annotate.JsonProperty
;
public
class
GitlabPersmission
{
@JsonProperty
(
"project_access"
)
private
GitlabProjectAccessLevel
_projectAccess
;
@JsonProperty
(
"group_access"
)
private
GitlabProjectAccessLevel
_groupAccess
;
public
GitlabProjectAccessLevel
getProjectAccess
()
{
return
_projectAccess
;
}
public
GitlabProjectAccessLevel
getProjectGroupAccess
()
{
return
_groupAccess
;
}
}
src/main/java/org/gitlab/api/models/GitlabProject.java
View file @
71efa977
package
org
.
gitlab
.
api
.
models
;
import
java.util.Date
;
import
org.codehaus.jackson.annotate.JsonProperty
;
import
java.util.Date
;
public
class
GitlabProject
{
public
static
final
String
URL
=
"/projects"
;
private
Integer
_
id
;
private
String
_
name
;
private
Integer
id
;
private
String
name
;
@JsonProperty
(
"name_with_namespace"
)
private
String
_
nameWithNamespace
;
private
String
nameWithNamespace
;
private
String
_
description
;
private
String
description
;
@JsonProperty
(
"default_branch"
)
private
String
_
defaultBranch
;
private
String
defaultBranch
;
private
GitlabUser
_
owner
;
private
boolean
_public
;
private
String
_
path
;
private
GitlabUser
owner
;
private
boolean
publicProject
;
private
String
path
;
@JsonProperty
(
"visibility_level"
)
private
Integer
_
visibilityLevel
;
private
Integer
visibilityLevel
;
@JsonProperty
(
"path_with_namespace"
)
private
String
_
pathWithNamespace
;
private
String
pathWithNamespace
;
@JsonProperty
(
"issues_enabled"
)
private
boolean
_
issuesEnabled
;
private
boolean
issuesEnabled
;
@JsonProperty
(
"merge_requests_enabled"
)
private
boolean
_
mergeRequestsEnabled
;
private
boolean
mergeRequestsEnabled
;
@JsonProperty
(
"snippets_enabled"
)
private
boolean
_
snippetsEnabled
;
private
boolean
snippetsEnabled
;
@JsonProperty
(
"wall_enabled"
)
private
boolean
_
wallEnabled
;
private
boolean
wallEnabled
;
@JsonProperty
(
"wiki_enabled"
)
private
boolean
_
wikiEnabled
;
private
boolean
wikiEnabled
;
@JsonProperty
(
"created_at"
)
private
Date
_
createdAt
;
private
Date
createdAt
;
@JsonProperty
(
"ssh_url_to_repo"
)
private
String
_
sshUrl
;
private
String
sshUrl
;
@JsonProperty
(
"web_url"
)
private
String
_
webUrl
;
private
String
webUrl
;
@JsonProperty
(
"http_url_to_repo"
)
private
String
_
httpUrl
;
private
String
httpUrl
;
@JsonProperty
(
"last_activity_at"
)
private
Date
_
lastActivityAt
;
private
Date
lastActivityAt
;
@JsonProperty
(
"archived"
)
private
boolean
_
archived
;
private
boolean
archived
;
private
GitlabNamespace
_
namespace
;
private
GitlabNamespace
namespace
;
@JsonProperty
(
"permissions"
)
private
GitlabPer
smission
_
permissions
;
private
GitlabPer
mission
permissions
;
public
Integer
getId
()
{
return
_
id
;
return
id
;
}
public
void
setId
(
Integer
id
)
{
_
id
=
id
;
this
.
id
=
id
;
}
public
String
getName
()
{
return
_
name
;
return
name
;
}
public
void
setName
(
String
name
)
{
_
name
=
name
;
this
.
name
=
name
;
}
public
String
getNameWithNamespace
()
{
return
_
nameWithNamespace
;
return
nameWithNamespace
;
}
public
void
setNameWithNamespace
(
String
nameWithNamespace
)
{
this
.
_
nameWithNamespace
=
nameWithNamespace
;
this
.
nameWithNamespace
=
nameWithNamespace
;
}
public
String
getDescription
()
{
return
_
description
;
return
description
;
}
public
void
setDescription
(
String
description
)
{
_
description
=
description
;
this
.
description
=
description
;
}
public
String
getDefaultBranch
()
{
return
_
defaultBranch
;
return
defaultBranch
;
}
public
void
setDefaultBranch
(
String
defaultBranch
)
{
_
defaultBranch
=
defaultBranch
;
this
.
defaultBranch
=
defaultBranch
;
}
public
Integer
getVisibilityLevel
()
{
return
_
visibilityLevel
;
return
visibilityLevel
;
}
public
void
setVisibilityLevel
(
Integer
visibilityLevel
)
{
this
.
_
visibilityLevel
=
visibilityLevel
;
this
.
visibilityLevel
=
visibilityLevel
;
}
public
GitlabUser
getOwner
()
{
return
_
owner
;
return
owner
;
}
public
void
setOwner
(
GitlabUser
owner
)
{
_
owner
=
owner
;
this
.
owner
=
owner
;
}
public
String
getPath
()
{
return
_
path
;
return
path
;
}
public
void
setPath
(
String
path
)
{
_
path
=
path
;
this
.
path
=
path
;
}
public
String
getPathWithNamespace
()
{
return
_
pathWithNamespace
;
return
pathWithNamespace
;
}
public
void
setPathWithNamespace
(
String
pathWithNamespace
)
{
_
pathWithNamespace
=
pathWithNamespace
;
this
.
pathWithNamespace
=
pathWithNamespace
;
}
public
boolean
isIssuesEnabled
()
{
return
_
issuesEnabled
;
return
issuesEnabled
;
}
public
void
setIssuesEnabled
(
boolean
issuesEnabled
)
{
_
issuesEnabled
=
issuesEnabled
;
this
.
issuesEnabled
=
issuesEnabled
;
}
public
boolean
isMergeRequestsEnabled
()
{
return
_
mergeRequestsEnabled
;
return
mergeRequestsEnabled
;
}
public
void
setMergeRequestsEnabled
(
boolean
mergeRequestsEnabled
)
{
_
mergeRequestsEnabled
=
mergeRequestsEnabled
;
this
.
mergeRequestsEnabled
=
mergeRequestsEnabled
;
}
public
boolean
isSnippetsEnabled
()
{
return
_
snippetsEnabled
;
return
snippetsEnabled
;
}
public
void
setSnippetsEnabled
(
boolean
snippetsEnabled
)
{
this
.
_
snippetsEnabled
=
snippetsEnabled
;
this
.
snippetsEnabled
=
snippetsEnabled
;
}
public
boolean
isWallEnabled
()
{
return
_
wallEnabled
;
return
wallEnabled
;
}
public
void
setWallEnabled
(
boolean
wallEnabled
)
{
_
wallEnabled
=
wallEnabled
;
this
.
wallEnabled
=
wallEnabled
;
}
public
boolean
isWikiEnabled
()
{
return
_
wikiEnabled
;
return
wikiEnabled
;
}
public
void
setWikiEnabled
(
boolean
wikiEnabled
)
{
_
wikiEnabled
=
wikiEnabled
;
this
.
wikiEnabled
=
wikiEnabled
;
}
public
Date
getCreatedAt
()
{
return
_
createdAt
;
return
createdAt
;
}
public
void
setCreatedAt
(
Date
createdAt
)
{
_
createdAt
=
createdAt
;
this
.
createdAt
=
createdAt
;
}
public
String
getSshUrl
()
{
return
_
sshUrl
;
return
sshUrl
;
}
public
void
setSshUrl
(
String
sshUrl
)
{
_
sshUrl
=
sshUrl
;
this
.
sshUrl
=
sshUrl
;
}
public
String
getWebUrl
()
{
return
_
webUrl
;
return
webUrl
;
}
public
void
setWebUrl
(
String
webUrl
)
{
_
webUrl
=
webUrl
;
this
.
webUrl
=
webUrl
;
}
public
String
getHttpUrl
()
{
return
_
httpUrl
;
return
httpUrl
;
}
public
void
setHttpUrl
(
String
httpUrl
)
{
_
httpUrl
=
httpUrl
;
this
.
httpUrl
=
httpUrl
;
}
public
GitlabNamespace
getNamespace
()
{
return
_
namespace
;
return
namespace
;
}
public
void
setNamespace
(
GitlabNamespace
namespace
)
{
_
namespace
=
namespace
;
this
.
namespace
=
namespace
;
}
public
boolean
isPublic
()
{
return
_public
;
return
publicProject
;
}
public
void
setPublic
(
boolean
aPublic
)
{
_public
=
aPublic
;
publicProject
=
aPublic
;
}
public
boolean
isArchived
()
{
return
_
archived
;
return
archived
;
}
public
void
setArchived
(
boolean
archived
)
{
_
archived
=
archived
;
this
.
archived
=
archived
;
}
public
Date
getLastActivityAt
()
{
return
_
lastActivityAt
;
return
lastActivityAt
;
}
public
void
setLastActivityAt
(
Date
lastActivityAt
)
{
_
lastActivityAt
=
lastActivityAt
;
this
.
lastActivityAt
=
lastActivityAt
;
}
public
GitlabPers
mission
getPermissions
()
{
return
_
permissions
;
public
GitlabPer
mission
getPermissions
()
{
return
permissions
;
}
public
void
setPermissions
(
GitlabPers
mission
permissions
)
{
this
.
_
permissions
=
permissions
;
public
void
setPermissions
(
GitlabPer
mission
permissions
)
{
this
.
permissions
=
permissions
;
}
}
src/main/java/org/gitlab/api/models/GitlabProjectAccessLevel.java
View file @
71efa977
...
...
@@ -5,27 +5,27 @@ import org.codehaus.jackson.annotate.JsonProperty;
public
class
GitlabProjectAccessLevel
{
@JsonProperty
(
"access_level"
)
private
int
_
accessLevel
;
private
int
accessLevel
;
@JsonProperty
(
"notification_level"
)
private
int
_
notificationLevel
;
private
int
notificationLevel
;
public
GitlabAccessLevel
getAccessLevel
()
{
return
GitlabAccessLevel
.
fromAccessValue
(
_
accessLevel
);
return
GitlabAccessLevel
.
fromAccessValue
(
accessLevel
);
}
public
void
setAccessLevel
(
GitlabAccessLevel
accessLevel
)
{
_
accessLevel
=
accessLevel
.
accessValue
;
this
.
accessLevel
=
accessLevel
.
accessValue
;
}
public
int
getNoficationLevel
()
{
return
_
notificationLevel
;
return
notificationLevel
;
}
public
void
setNoficationLevel
(
int
notificationLevel
)
{
this
.
_accessLevel
=
notificationLevel
;
this
.
accessLevel
=
notificationLevel
;
}
...
...
src/main/java/org/gitlab/api/models/GitlabProjectHook.java
View file @
71efa977
package
org
.
gitlab
.
api
.
models
;
import
java.util.Date
;
import
org.codehaus.jackson.annotate.JsonProperty
;
import
java.util.Date
;
public
class
GitlabProjectHook
{
public
final
static
String
URL
=
"/hooks"
;
private
String
_id
;
private
String
_url
;
private
Integer
_projectId
;
private
String
id
;
private
String
url
;
private
Integer
projectId
;
@JsonProperty
(
"push_events"
)
private
boolean
_
pushEvents
;
private
boolean
pushEvents
;
@JsonProperty
(
"issues_events"
)
private
boolean
_
issueEvents
;
private
boolean
issueEvents
;
@JsonProperty
(
"merge_requests_events"
)
private
boolean
_
mergeRequestsEvents
;
private
boolean
mergeRequestsEvents
;
@JsonProperty
(
"created_at"
)
private
Date
_createdAt
;
private
Date
createdAt
;
public
String
getId
()
{
return
_
id
;
return
id
;
}
public
void
setId
(
String
id
)
{
_
id
=
id
;
this
.
id
=
id
;
}
public
String
getUrl
()
{
return
_
url
;
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
_
url
=
url
;
this
.
url
=
url
;
}
public
Integer
getProjectId
()
{
return
_
projectId
;
return
projectId
;
}
public
void
setProjectId
(
Integer
projectId
)
{
_
projectId
=
projectId
;
this
.
projectId
=
projectId
;
}
public
boolean
getPushEvents
()
{
return
_
pushEvents
;
return
pushEvents
;
}
public
void
setPushEvents
(
boolean
pushEvents
)
{
_
pushEvents
=
pushEvents
;
this
.
pushEvents
=
pushEvents
;
}
public
boolean
getIssueEvents
()
{
return
_
issueEvents
;
return
issueEvents
;
}
public
void
setIssueEvents
(
boolean
issueEvents
)
{
_
issueEvents
=
issueEvents
;
this
.
issueEvents
=
issueEvents
;
}
public
boolean
isMergeRequestsEvents
()
{
return
_
mergeRequestsEvents
;
return
mergeRequestsEvents
;
}
public
void
setMergeRequestsEvents
(
boolean
mergeRequestsEvents
)
{
_
mergeRequestsEvents
=
mergeRequestsEvents
;
this
.
mergeRequestsEvents
=
mergeRequestsEvents
;
}
public
Date
getCreatedAt
()
{
return
_
createdAt
;
return
createdAt
;
}
public
void
setCreatedAt
(
Date
createdAt
)
{
_
createdAt
=
createdAt
;
this
.
createdAt
=
createdAt
;
}
}
src/main/java/org/gitlab/api/models/GitlabSession.java
View file @
71efa977
...
...
@@ -3,17 +3,18 @@ package org.gitlab.api.models;
import
org.codehaus.jackson.annotate.JsonProperty
;
public
class
GitlabSession
extends
GitlabUser
{
public
static
final
String
URL
=
"/session"
;
@JsonProperty
(
"private_token"
)
private
String
_
privateToken
;
private
String
privateToken
;
public
String
getPrivateToken
()
{
return
_
privateToken
;
return
privateToken
;
}
public
void
setPrivateToken
(
String
privateToken
)
{
_
privateToken
=
privateToken
;
this
.
privateToken
=
privateToken
;
}
}
src/main/java/org/gitlab/api/models/GitlabUser.java
View file @
71efa977
package
org
.
gitlab
.
api
.
models
;
import
java.util.Date
;
import
org.codehaus.jackson.annotate.JsonProperty
;
import
java.util.Date
;
public
class
GitlabUser
{
public
static
String
URL
=
"/users"
;
public
static
String
USERS_URL
=
"/users"
;
...
...
src/test/java/org/gitlab/api/GitlabAPIT.java
View file @
71efa977
package
org
.
gitlab
.
api
;
import
org.gitlab.api.models.GitlabUser
;
import
org.junit.Assert
;
import
org.junit.Before
;
import
org.junit.Test
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.net.ConnectException
;
import
java.net.URL
;
import
java.util.UUID
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
static
org
.
junit
.
Assert
.
*
;
import
static
org
.
junit
.
Assume
.
assumeNoException
;
import
java.net.ConnectException
;
public
class
GitlabAPIT
{
GitlabAPI
_
api
;
GitlabAPI
api
;
private
static
final
String
TEST_URL
=
System
.
getProperty
(
"TEST_URL"
,
"http://localhost"
);
private
static
final
String
TEST_TOKEN
=
System
.
getProperty
(
"TEST_TOKEN"
,
"y0E5b9761b7y4qk"
);
...
...
@@ -25,12 +23,11 @@ public class GitlabAPIT {
String
rand
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
).
substring
(
0
,
8
);
@Before
public
void
setup
()
throws
IOException
{
_
api
=
GitlabAPI
.
connect
(
TEST_URL
,
TEST_TOKEN
);
api
=
GitlabAPI
.
connect
(
TEST_URL
,
TEST_TOKEN
);
try
{
_
api
.
dispatch
().
with
(
"login"
,
"INVALID"
).
with
(
"password"
,
rand
).
to
(
"session"
,
GitlabUser
.
class
);
api
.
dispatch
().
with
(
"login"
,
"INVALID"
).
with
(
"password"
,
rand
).
to
(
"session"
,
GitlabUser
.
class
);
}
catch
(
ConnectException
e
)
{
assumeNoException
(
"GITLAB not running on '"
+
TEST_URL
+
"', skipping..."
,
e
);
}
catch
(
IOException
e
)
{
...
...
@@ -43,19 +40,19 @@ public class GitlabAPIT {
@Test
public
void
testConnect
()
throws
IOException
{
assertEquals
(
GitlabAPI
.
class
,
_
api
.
getClass
());
assertEquals
(
GitlabAPI
.
class
,
api
.
getClass
());
}
@Test
public
void
testGetAPIUrl
()
throws
IOException
{
URL
expected
=
new
URL
(
TEST_URL
+
"/api/v3/?private_token="
+
TEST_TOKEN
);
assertEquals
(
expected
,
_
api
.
getAPIUrl
(
""
));
URL
expected
=
new
URL
(
TEST_URL
+
"/api/v3/?private_token="
+
TEST_TOKEN
);
assertEquals
(
expected
,
api
.
getAPIUrl
(
""
));
}
@Test
public
void
testGetUrl
()
throws
IOException
{
URL
expected
=
new
URL
(
TEST_URL
);
assertEquals
(
expected
+
"/"
,
_
api
.
getUrl
(
""
).
toString
());
assertEquals
(
expected
+
"/"
,
api
.
getUrl
(
""
).
toString
());
}
@Test
...
...
@@ -64,14 +61,14 @@ public class GitlabAPIT {
String
password
=
randVal
(
"$%password"
);
GitlabUser
gitUser
=
_api
.
createUser
(
randVal
(
"testEmail@gitlabapitest.com"
),
GitlabUser
gitUser
=
api
.
createUser
(
randVal
(
"testEmail@gitlabapitest.com"
),
password
,
randVal
(
"userName"
),
randVal
(
"fullName"
),
randVal
(
"skypeId"
),
randVal
(
"linledin"
),
randVal
(
"twitter"
),
"http://"
+
randVal
(
"url.com"
),
"http://"
+
randVal
(
"url.com"
),
10
,
randVal
(
"externuid"
),
randVal
(
"externprovidername"
),
...
...
@@ -79,36 +76,35 @@ public class GitlabAPIT {
false
,
false
,
false
);
Assert
.
assertNotNull
(
gitUser
);
assertNotNull
(
gitUser
);
GitlabUser
refetched
=
_
api
.
getUserViaSudo
(
gitUser
.
getUsername
());
GitlabUser
refetched
=
api
.
getUserViaSudo
(
gitUser
.
getUsername
());
Assert
.
assertNotNull
(
refetched
);
assertNotNull
(
refetched
);
Assert
.
assertEquals
(
refetched
.
getUsername
(),
gitUser
.
getUsername
());
assertEquals
(
refetched
.
getUsername
(),
gitUser
.
getUsername
());
_api
.
updateUser
(
gitUser
.
getId
(),
gitUser
.
getEmail
(),
password
,
gitUser
.
getUsername
(),
api
.
updateUser
(
gitUser
.
getId
(),
gitUser
.
getEmail
(),
password
,
gitUser
.
getUsername
(),
gitUser
.
getName
(),
"newSkypeId"
,
gitUser
.
getLinkedin
(),
gitUser
.
getTwitter
(),
gitUser
.
getWebsiteUrl
(),
10
/* project limit does not come back on GET */
,
gitUser
.
getExternUid
(),
gitUser
.
getExternProviderName
(),
gitUser
.
getBio
(),
gitUser
.
isAdmin
(),
gitUser
.
isCanCreateGroup
(),
false
);
GitlabUser
postUpdate
=
_
api
.
getUserViaSudo
(
gitUser
.
getUsername
());
GitlabUser
postUpdate
=
api
.
getUserViaSudo
(
gitUser
.
getUsername
());
Assert
.
assertNotNull
(
postUpdate
);
Assert
.
assertEquals
(
postUpdate
.
getSkype
(),
"newSkypeId"
);
assertNotNull
(
postUpdate
);
assertEquals
(
postUpdate
.
getSkype
(),
"newSkypeId"
);
_
api
.
deleteUser
(
postUpdate
.
getId
());
api
.
deleteUser
(
postUpdate
.
getId
());
// expect a 404, but we have no access to it
try
{
GitlabUser
shouldNotExist
=
_api
.
getUser
(
postUpdate
.
getId
());
Assert
.
assertNull
(
shouldNotExist
);
// should never even get here
}
catch
(
FileNotFoundException
thisIsSoOddForAnRESTApiClient
)
{
Assert
.
assertTrue
(
true
);
// expected
GitlabUser
shouldNotExist
=
api
.
getUser
(
postUpdate
.
getId
());
assertNull
(
shouldNotExist
);
}
catch
(
FileNotFoundException
thisIsSoOddForAnRESTApiClient
)
{
assertTrue
(
true
);
// expected
}
...
...
src/test/java/org/gitlab/api/http/QueryTest.java
View file @
71efa977
package
org
.
gitlab
.
api
.
http
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
java.io.UnsupportedEncodingException
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
public
class
QueryTest
{
@Test
...
...
@@ -59,7 +60,7 @@ public class QueryTest {
@Test
public
void
conditionalAppend_null_notNull
()
throws
UnsupportedEncodingException
{
Query
query
=
new
Query
()
.
appendIf
(
"p1"
,
(
String
)
null
)
.
appendIf
(
"p1"
,
(
String
)
null
)
.
appendIf
(
"p2"
,
"v2"
);
assertEquals
(
"?p2=v2"
,
query
.
toString
());
...
...
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