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
932c6bba
Commit
932c6bba
authored
Oct 01, 2019
by
Greg Messner
Browse files
Added newly implemented APIs.
parent
03f72a35
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
932c6bba
...
@@ -50,7 +50,7 @@ To utilize GitLab4J™ API in your Java project, simply add the following de
...
@@ -50,7 +50,7 @@ To utilize GitLab4J™ API in your Java project, simply add the following de
```
java
```
java
dependencies
{
dependencies
{
...
...
compile
group:
'
org
.
gitlab4j
'
,
name:
'
gitlab4j
-
api
'
,
version:
'
4.12
.
8
'
compile
group:
'
org
.
gitlab4j
'
,
name:
'
gitlab4j
-
api
'
,
version:
'
4.12
.
9
'
}
}
```
```
...
@@ -61,7 +61,7 @@ dependencies {
...
@@ -61,7 +61,7 @@ dependencies {
<dependency>
<dependency>
<groupId>
org.gitlab4j
</groupId>
<groupId>
org.gitlab4j
</groupId>
<artifactId>
gitlab4j-api
</artifactId>
<artifactId>
gitlab4j-api
</artifactId>
<version>
4.12.
8
</version>
<version>
4.12.
9
</version>
</dependency>
</dependency>
```
```
...
@@ -268,6 +268,9 @@ The following is a list of the available sub APIs along with a sample use of eac
...
@@ -268,6 +268,9 @@ The following is a list of the available sub APIs along with a sample use of eac
[IssuesApi](#issuesapi)<br/>
[IssuesApi](#issuesapi)<br/>
[JobApi](#jobapi)<br/>
[JobApi](#jobapi)<br/>
[LabelsApi](#labelsapi)<br/>
[LabelsApi](#labelsapi)<br/>
[LicenseApi](#licenseapi)<br/>
[LicenseTemplatesApi](#licensetemplatesapi)<br/>
[LabelsApi](#labelsapi)<br/>
[MergeRequestApi](#mergerequestapi)<br/>
[MergeRequestApi](#mergerequestapi)<br/>
[MilestonesApi](#milestonesapi)<br/>
[MilestonesApi](#milestonesapi)<br/>
[NamespaceApi](#namespaceapi)<br/>
[NamespaceApi](#namespaceapi)<br/>
...
@@ -285,6 +288,7 @@ The following is a list of the available sub APIs along with a sample use of eac
...
@@ -285,6 +288,7 @@ The following is a list of the available sub APIs along with a sample use of eac
[SessionApi](#sessionapi)<br/>
[SessionApi](#sessionapi)<br/>
[SnippetsApi](#snippetsapi)<br/>
[SnippetsApi](#snippetsapi)<br/>
[SystemHooksApi](#systemhooksapi)<br/>
[SystemHooksApi](#systemhooksapi)<br/>
[TodosApi](#todosapi)<br/>
[UserApi](#userapi)<br/>
[UserApi](#userapi)<br/>
[WikisApi](#wikisapi)
[WikisApi](#wikisapi)
...
@@ -397,6 +401,18 @@ List<Job> jobs = gitLabApi.getJobApi().getJobs(1234);
...
@@ -397,6 +401,18 @@ List<Job> jobs = gitLabApi.getJobApi().getJobs(1234);
List
<Label>
labels = gitLabApi.getLabelsApi().getLabels(1234);
List
<Label>
labels = gitLabApi.getLabelsApi().getLabels(1234);
```
```
#### LicenseApi
```
java
// Retrieve information about the current license
License license = gitLabApi.getLicenseApi().getLicense();
```
#### LicenseTemplatesApi
```
java
// Get a list of open sourcse license templates
List
<LicenseTemplate>
licenses = gitLabApi.getLicenseTemplateApi().getLicenseTemplates();
```
#### MergeRequestApi
#### MergeRequestApi
```
java
```
java
// Get a list of the merge requests for the specified project
// Get a list of the merge requests for the specified project
...
@@ -515,6 +531,12 @@ List<Snippet> snippets = gitLabApi.getSnippetsApi().getSnippets();
...
@@ -515,6 +531,12 @@ List<Snippet> snippets = gitLabApi.getSnippetsApi().getSnippets();
List
<
SystemHook
>
hooks
=
gitLabApi
.
getSystemHooksApi
().
getSystemHooks
();
List
<
SystemHook
>
hooks
=
gitLabApi
.
getSystemHooksApi
().
getSystemHooks
();
```
```
#### TodosApi
```
java
// Get a list of all pending todos for the current user
List
<
Todo
>
todos
=
gitLabApi
.
getTodosApi
().
gePendingTodos
();
```
#### UserApi
#### UserApi
```
java
```
java
// Get the User info for user_id 1
// Get the User info for user_id 1
...
...
src/main/java/org/gitlab4j/api/GitLabApi.java
View file @
932c6bba
...
@@ -67,7 +67,8 @@ public class GitLabApi {
...
@@ -67,7 +67,8 @@ public class GitLabApi {
private
IssuesApi
issuesApi
;
private
IssuesApi
issuesApi
;
private
JobApi
jobApi
;
private
JobApi
jobApi
;
private
LabelsApi
labelsApi
;
private
LabelsApi
labelsApi
;
private
LicensesApi
licensesApi
;
private
LicenseApi
licenseApi
;
private
LicenseTemplatesApi
licenseTemplatesApi
;
private
MarkdownApi
markdownApi
;
private
MarkdownApi
markdownApi
;
private
MergeRequestApi
mergeRequestApi
;
private
MergeRequestApi
mergeRequestApi
;
private
MilestonesApi
milestonesApi
;
private
MilestonesApi
milestonesApi
;
...
@@ -87,9 +88,9 @@ public class GitLabApi {
...
@@ -87,9 +88,9 @@ public class GitLabApi {
private
SnippetsApi
snippetsApi
;
private
SnippetsApi
snippetsApi
;
private
SystemHooksApi
systemHooksApi
;
private
SystemHooksApi
systemHooksApi
;
private
TagsApi
tagsApi
;
private
TagsApi
tagsApi
;
private
TodosApi
todosApi
;
private
UserApi
userApi
;
private
UserApi
userApi
;
private
WikisApi
wikisApi
;
private
WikisApi
wikisApi
;
private
TodosApi
todosApi
;
/**
/**
* Get the GitLab4J shared Logger instance.
* Get the GitLab4J shared Logger instance.
...
@@ -1200,24 +1201,44 @@ public class GitLabApi {
...
@@ -1200,24 +1201,44 @@ public class GitLabApi {
}
}
/**
/**
* Gets the License
s
Api instance owned by this GitLabApi instance. The License
s
Api is used
* Gets the LicenseApi instance owned by this GitLabApi instance. The LicenseApi is used
* to perform all license related API calls.
* to perform all license related API calls.
*
*
* @return the LicensesApi instance owned by this GitLabApi instance
* @return the LicenseApi instance owned by this GitLabApi instance
*/
public
LicenseApi
getLicenseApi
()
{
if
(
licenseApi
==
null
)
{
synchronized
(
this
)
{
if
(
licenseApi
==
null
)
{
licenseApi
=
new
LicenseApi
(
this
);
}
}
}
return
(
licenseApi
);
}
/**
* Gets the LicenseTemplatesApi instance owned by this GitLabApi instance. The LicenseTemplatesApi is used
* to perform all license template related API calls.
*
* @return the LicenseTemplatesApi instance owned by this GitLabApi instance
*/
*/
public
LicensesApi
getLicensesApi
()
{
public
License
Template
sApi
getLicense
Template
sApi
()
{
if
(
licensesApi
==
null
)
{
if
(
license
Template
sApi
==
null
)
{
synchronized
(
this
)
{
synchronized
(
this
)
{
if
(
licensesApi
==
null
)
{
if
(
license
Template
sApi
==
null
)
{
licensesApi
=
new
LicensesApi
(
this
);
license
Template
sApi
=
new
License
Template
sApi
(
this
);
}
}
}
}
}
}
return
(
licensesApi
);
return
(
license
Template
sApi
);
}
}
/**
/**
* Gets the MarkdownApi instance owned by this GitLabApi instance. The MarkdownApi is used
* Gets the MarkdownApi instance owned by this GitLabApi instance. The MarkdownApi is used
* to perform all markdown related API calls.
* to perform all markdown related API calls.
...
@@ -1559,6 +1580,41 @@ public class GitLabApi {
...
@@ -1559,6 +1580,41 @@ public class GitLabApi {
return
(
tagsApi
);
return
(
tagsApi
);
}
}
/**
* Gets the SnippetsApi instance owned by this GitLabApi instance. The SnippetsApi is used
* to perform all snippet related API calls.
*
* @return the SnippetsApi instance owned by this GitLabApi instance
*/
public
SnippetsApi
getSnippetApi
()
{
if
(
snippetsApi
==
null
)
{
synchronized
(
this
)
{
if
(
snippetsApi
==
null
)
{
snippetsApi
=
new
SnippetsApi
(
this
);
}
}
}
return
snippetsApi
;
}
/**
* Gets the TodosApi instance owned by this GitLabApi instance. The TodosApi is used to perform all Todo related API calls.
*
* @return the TodosApi instance owned by this GitLabApi instance
*/
public
TodosApi
getTodosApi
()
{
if
(
todosApi
==
null
)
{
synchronized
(
this
)
{
if
(
todosApi
==
null
)
{
todosApi
=
new
TodosApi
(
this
);
}
}
}
return
todosApi
;
}
/**
/**
* Gets the UserApi instance owned by this GitLabApi instance. The UserApi is used
* Gets the UserApi instance owned by this GitLabApi instance. The UserApi is used
* to perform all user related API calls.
* to perform all user related API calls.
...
@@ -1578,6 +1634,23 @@ public class GitLabApi {
...
@@ -1578,6 +1634,23 @@ public class GitLabApi {
return
(
userApi
);
return
(
userApi
);
}
}
/**
* Gets the WikisApi instance owned by this GitLabApi instance. The WikisApi is used to perform all wiki related API calls.
*
* @return the WikisApi instance owned by this GitLabApi instance
*/
public
WikisApi
getWikisApi
()
{
if
(
wikisApi
==
null
)
{
synchronized
(
this
)
{
if
(
wikisApi
==
null
)
{
wikisApi
=
new
WikisApi
(
this
);
}
}
}
return
wikisApi
;
}
/**
/**
* Create and return an Optional instance associated with a GitLabApiException.
* Create and return an Optional instance associated with a GitLabApiException.
*
*
...
@@ -1621,56 +1694,4 @@ public class GitLabApi {
...
@@ -1621,56 +1694,4 @@ public class GitLabApi {
return
(
optional
.
get
());
return
(
optional
.
get
());
}
}
/**
* Gets the SnippetsApi instance owned by this GitLabApi instance. The SnippetsApi is used
* to perform all snippet related API calls.
*
* @return the SnippetsApi instance owned by this GitLabApi instance
*/
public
SnippetsApi
getSnippetApi
()
{
if
(
snippetsApi
==
null
)
{
synchronized
(
this
)
{
if
(
snippetsApi
==
null
)
{
snippetsApi
=
new
SnippetsApi
(
this
);
}
}
}
return
snippetsApi
;
}
/**
* Gets the WikisApi instance owned by this GitLabApi instance. The WikisApi is used to perform all wiki related API calls.
*
* @return the WikisApi instance owned by this GitLabApi instance
*/
public
WikisApi
getWikisApi
()
{
if
(
wikisApi
==
null
)
{
synchronized
(
this
)
{
if
(
wikisApi
==
null
)
{
wikisApi
=
new
WikisApi
(
this
);
}
}
}
return
wikisApi
;
}
/**
* Gets the TodosApi instance owned by this GitLabApi instance. The TodosApi is used to perform all todo related API calls.
*
* @return the TodosApi instance owned by this GitLabApi instance
*/
public
TodosApi
getTodosApi
()
{
if
(
todosApi
==
null
)
{
synchronized
(
this
)
{
if
(
todosApi
==
null
)
{
todosApi
=
new
TodosApi
(
this
);
}
}
}
return
todosApi
;
}
}
}
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