Skip to content

Commit c1c4cf5

Browse files
authored
Added headers to all sections.
1 parent 38a0df3 commit c1c4cf5

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

README.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ dependencies {
2727
Javadocs are available here: <a href="http://www.messners.com/gitlab4j-api/javadocs/index.html?overview-summary.html" target="_top">Javadocs</a>
2828

2929
---
30+
## Using GitLab4J
3031

3132
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:
3233
```java
@@ -58,7 +59,7 @@ gitLabApi.unsudo();
5859
```
5960

6061
---
61-
62+
## GitLab API V3 and V4 Support
6263
As of GitLab4J-API 4.2.0 support has been added for GitLab API V4. If your application requires GitLab API V3,
6364
you can still use GitLab4J-API by creating your GitLabApi instance as follows:
6465
```java
@@ -67,7 +68,7 @@ GitLabApi gitLabApi = new GitLabApi(ApiVersion.V3, "http://your.gitlab.server.co
6768
```
6869

6970
---
70-
71+
## Results Paging
7172
GitLab4J-API provides an easy to use paging mechanism to page through lists of results from the GitLab API.
7273
Here are a couple of examples on how to use the Pager:
7374
```java
@@ -92,10 +93,10 @@ while (commitPager.hasNext())
9293
allCommits.addAll(commitPager.next());
9394
```
9495
---
95-
96+
## Making API Calls
9697
The API has been broken up into sub APIs classes to make it easier to learn and to separate concerns. Following is a list of the sub APIs along with a sample use of each API. See the <a href="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.
9798

98-
Available Sub APIs
99+
### Available Sub APIs
99100
------------------
100101
&nbsp;&nbsp;[CommitsApi](#commitsapi)<br/>
101102
&nbsp;&nbsp;[DeployKeysApi](#deploykeysapi)<br/>
@@ -117,10 +118,10 @@ Available Sub APIs
117118
&nbsp;&nbsp;[UserApi](#userapi)
118119

119120

120-
Sub API Examples
121+
### Sub API Examples
121122
----------------
122123

123-
### CommitsApi
124+
#### CommitsApi
124125
```java
125126
// Get a list of commits associated with the specified branch that fall within the specified time window
126127
// This uses the ISO8601 date utilities the in org.gitlab4j.api.utils.ISO8601 class
@@ -129,39 +130,39 @@ Date until = new Date(); // now
129130
List<Commit> commits = gitLabApi.getCommitsApi().getCommits(1234, "new-feature", since, until);
130131
```
131132

132-
### DeployKeysApi
133+
#### DeployKeysApi
133134
```java
134135
// Get a list of DeployKeys for the authenticated user
135136
List<DeployKey> deployKeys = gitLabApi.getDeployKeysApi().getDeployKeys();
136137
```
137138

138-
### EventsApi
139+
#### EventsApi
139140
```java
140141
// Get a list of Events for the authenticated user
141142
Date after = new Date(0); // After Eposc
142143
Date before = new Date(); // Before now
143144
List<Event> events = gitLabApi.getEventsApi().getAuthenticatedUserEvents(null, null, before, after, DESC);
144145
```
145146

146-
### GroupApi
147+
#### GroupApi
147148
```java
148149
// Get a list of groups that you have access to
149150
List<Group> groups = gitLabApi.getGroupApi().getGroups();
150151
```
151152

152-
### IssuesApi
153+
#### IssuesApi
153154
```java
154155
// Get a list of issues for the specified project ID
155156
List<Issue> issues = gitLabApi.getIssuesApi().getIssues(1234);
156157
```
157158

158-
### JobApi
159+
#### JobApi
159160
```java
160161
// Get a list of jobs for the specified project ID
161162
List<Job> jobs = gitLabApi.getJobApi().getJobs(1234);
162163
```
163164

164-
### LabelsApi
165+
#### LabelsApi
165166
```java
166167
// Get a list of labels for the specified project ID
167168
List<Label> labels = gitLabApi.getLabelsApi().getLabels(1234);
@@ -173,31 +174,31 @@ List<Label> labels = gitLabApi.getLabelsApi().getLabels(1234);
173174
List<MergeRequest> mergeRequests = gitLabApi.getMergeRequestApi().getMergeRequests(1234);
174175
```
175176

176-
### MilestonesApi
177+
#### MilestonesApi
177178
```java
178179
// Get a list of the milestones for the specified project
179180
List<Milestone> milestones = gitLabApi.getMilestonesApi().getMilestones(1234);
180181
```
181182

182-
### NamespaceApi
183+
#### NamespaceApi
183184
```java
184185
// Get all namespaces that match "foobar" in their name or path
185186
List<Namespace> namespaces = gitLabApi.getNamespaceApi().findNamespaces("foobar");
186187
```
187188

188-
### NotesApi
189+
#### NotesApi
189190
```java
190191
// Get a list of the issues's notes for project ID 1234, issue IID 1
191192
List<Note> notes = getNotes(1234, 1);
192193
```
193194

194-
### PipelineApi
195+
#### PipelineApi
195196
```java
196197
// Get all pipelines for the specified project ID
197198
List<Pipeline> pipelines = gitLabApi.getPipelineApi().getPipelines(1234);
198199
```
199200

200-
### ProjectApi
201+
#### ProjectApi
201202
```java
202203
// Get a list of accessible projects
203204
public List<Project> projects = gitLabApi.getProjectApi().getProjects();
@@ -216,31 +217,31 @@ Project projectSpec = new Project()
216217
Project newProject = gitLabApi.getProjectApi().createProject(projectSpec);
217218
```
218219

219-
### RepositoryApi
220+
#### RepositoryApi
220221
```java
221222
// Get a list of repository branches from a project, sorted by name alphabetically
222223
List<Branch> branches = gitLabApi.getRepositoryApi().getBranches();
223224
```
224225

225-
### RepositoryFileApi
226+
#### RepositoryFileApi
226227
```java
227228
// Get info (name, size, ...) and the content from a file in repository
228229
RepositoryFile file = gitLabApi.getRepositoryFileApi().getFile("file-path", 1234, "ref");
229230
```
230231

231-
### ServicesApi
232+
#### ServicesApi
232233
```java
233234
// Activates the gitlab-ci service.
234235
getLabApi.getServicesApi().setGitLabCI("project-name", "auth-token", "project-ci-url");
235236
```
236237

237-
### SessionApi
238+
#### SessionApi
238239
```java
239240
// Log in to the GitLab server and get the session info
240241
getLabApi.getSessionApi().login("your-username", "your-email", "your-password");
241242
```
242243

243-
### UserApi
244+
#### UserApi
244245
```java
245246
// Get the User info for user_id 1
246247
User user = gitLabApi.getUserApi().getUser(1);

0 commit comments

Comments
 (0)