You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+59-31Lines changed: 59 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,45 @@
6
6
GitLab4J™ API (gitlab4j-api) provides a full featured and easy to consume Java library for working with GitLab repositories via the GitLab REST API. Additionally, full support for working with GitLab webhooks and system hooks is also provided.
7
7
8
8
---
9
+
## Table of Contents
10
+
*[GitLab Server Version Support](#gitLab%20server%20version%20support)<br/>
*[Issue Time Estimates](#issue%20time%20estimates)<br/>
25
+
*[Making API Calls](#making%20api%20calls)<br/>
26
+
*[Available Sub APIs](#available%20sub%20apis)
9
27
28
+
---
29
+
## GitLab Server Version Support
30
+
31
+
GitLab4J-API supports version 11.0+ of GitLab Community Edition [(gitlab-ce)](https://gitlab.com/gitlab-org/gitlab-ce/) and GitLab Enterprise Edition [(gitlab-ee)](https://gitlab.com/gitlab-org/gitlab-ee/).
32
+
33
+
GitLab released GitLab Version 11.0 in June of 2018 which included many major changes to GitLab. If you are using GitLab server earlier than version 11.0, it is highly recommended that you either update your GitLab install or use a version of this library that was released around the same time as the version of GitLab you are using.
34
+
35
+
**NOTICE**:
36
+
As of GitLab 11.0 support for the GitLab API v3 has been removed from the GitLab server (see https://about.gitlab.com/2018/06/01/api-v3-removal-impending/). Support for GitLab API v3 will be removed from this library sometime in 2019. If you are utilizing the v3 support, please update your code as soon as possible to use GitLab API v4.
37
+
38
+
---
39
+
## Using GitLab4J-API
40
+
41
+
### **Java 8 Requirement**
42
+
As of GitLab4J-API 4.8.0, Java 8+ is now required to use GitLab4J-API.
43
+
44
+
### **Javadocs**
45
+
Javadocs are available here: <ahref="http://www.messners.com/gitlab4j-api/javadocs/index.html?overview-summary.html"target="_top">Javadocs</a>
46
+
47
+
### **Project Set Up**
10
48
To utilize GitLab4J™ API in your Java project, simply add the following dependency to your project's build file:<br />
11
49
**Gradle: build.gradle**
12
50
```java
@@ -34,22 +72,12 @@ There have been reports of problems resolving some dependencies when using Ivy o
34
72
35
73
---
36
74
37
-
## Javadocs
38
-
Javadocs are available here: <ahref="http://www.messners.com/gitlab4j-api/javadocs/index.html?overview-summary.html"target="_top">Javadocs</a>
75
+
### **Usage Examples**
39
76
40
-
---
41
-
42
-
## Java 8 Requirement
43
-
As of GitLab4J-API 4.8.0, Java 8+ is now required to use GitLab4J-API.
44
-
45
-
---
46
-
47
-
## Using GitLab4J
48
-
49
-
GitLab4J-API is quite simple to use, all you need is the URL to your GitLab server and the Private Token from your GitLab Account Settings page. Once you have that info it is as simple as:
77
+
GitLab4J-API is quite simple to use, all you need is the URL to your GitLab server and the Personal Access Token from your GitLab Account Settings page. Once you have that info it is as simple as:
50
78
```java
51
79
// Create a GitLabApi instance to communicate with your GitLab server
As of GitLab4J-API 4.6.6, all API requests support performing the API call as if you were another user, provided you are authenticated as an administrator:
64
92
```java
65
93
// Create a GitLabApi instance to communicate with your GitLab server (must be an administrator)
As of GitLab 11.0 support for the GitLab API v3 has been removed (see https://about.gitlab.com/2018/06/01/api-v3-removal-impending/). Support for GitLab API v3 will be removed from this library in January 2019. If you are utilizing the v3 support, please update your code before January 2019.
106
-
133
+
As of GitLab 11.0 support for the GitLab API v3 has been removed from the GitLab server (see https://about.gitlab.com/2018/06/01/api-v3-removal-impending/). Support for GitLab API v3 will be removed from this library sometime in 2019. If you are utilizing the v3 support, please update your code as soon as possible to use GitLab API v4.
107
134
108
135
---
109
-
##Logging of API Requests and Responses
136
+
### **Logging of API Requests and Responses**
110
137
As of GitLab4J-API 4.8.39 support has been added to log the requests to and the responses from the
111
138
GitLab API. Enable logging using one of the following methods on the GitLabApi instance:
As of GitLab4J-API 4.9.2, all GitLabJ-API methods that return a List result have a similarlly named method that returns a Java 8 Stream. The Stream returning methods use the following naming convention: ```getXxxxxStream()```.
157
184
158
185
@@ -162,7 +189,7 @@ The built-in methods that return a Stream do so using ___eager evaluation___, me
162
189
To stream using ___lazy evaluation___, use the GitLab4J-API methods that return a ```Pager``` instance, and then call the ```lazyStream()``` method on the ```Pager``` instance to create a lazy evaluation Stream. The Stream utilizes the ```Pager``` instance to page through the available items. **A lazy Stream does NOT support parallel operations or skipping.**
163
190
164
191
165
-
**Eager evaluation example usage:**
192
+
#### **Eager evaluation example usage:**
166
193
167
194
```java
168
195
// Stream the visible projects printing out the project name.
GitLab4J-API supports Java 8 Optional<T> for API calls that result in the return of a single item. Here is an example on how to use the Java 8 Optional<T> API calls:
The following is a list of the available sub APIs along with a sample use of each API. See the <ahref="http://www.messners.com/gitlab4j-api/javadocs/index.html?org/gitlab4j/api/package-summary.html"target="_top">Javadocs</a> for a complete list of available methods for each sub API.
0 commit comments