Skip to content

Commit 9cac3b0

Browse files
authored
Added links to sub APIs.
1 parent 83184f9 commit 9cac3b0

File tree

1 file changed

+34
-29
lines changed

1 file changed

+34
-29
lines changed

README.md

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,26 @@ The API has been broken up into sub APIs classes to make it easier to learn and
7777

7878
Available Sub APIs
7979
------------------
80-
```
81-
CommitsApi
82-
EventsApi
83-
GroupApi
84-
JobApi
85-
MergeRequestApi
86-
NamespaceApi
87-
NotesApi
88-
PipelineApi
89-
ProjectApi
90-
RepositoryApi
91-
RepositoryFileApi
92-
ServicesApi
93-
SessionApi
94-
UserApi
95-
```
80+
&nbsp;&nbsp;[CommitsApi](#commitsapi)<br/>
81+
&nbsp;&nbsp;[EventsApi](#eventsapi)<br/>
82+
&nbsp;&nbsp;[GroupApi](#groupapi)<br/>
83+
&nbsp;&nbsp;[JobApi](#jobapi)<br/>
84+
&nbsp;&nbsp;[MergeRequestApi](#mergerequestapi)<br/>
85+
&nbsp;&nbsp;[NamespaceApi](#namespaceapi)<br/>
86+
&nbsp;&nbsp;[NotesApi](#notesapi)<br/>
87+
&nbsp;&nbsp;[PipelineApi](#pipelineapi)<br/>
88+
&nbsp;&nbsp;[ProjectApi](#projectapi)<br/>
89+
&nbsp;&nbsp;[RepositoryApi](#repositoryapi)<br/>
90+
&nbsp;&nbsp;[RepositoryFileApi](#repositoryfileapi)<br/>
91+
&nbsp;&nbsp;[ServicesApi](#servicesapi)<br/>
92+
&nbsp;&nbsp;[SessionApi](#sessionapi)<br/>
93+
&nbsp;&nbsp;[UserApi](#userapi)
94+
9695

9796
Sub API Examples
9897
----------------
9998

100-
CommitsApi:
99+
### CommitsApi
101100
```java
102101
// Get a list of commits associated with the specified branch that fall within the specified time window
103102
// This uses the ISO8601 date utilities the in org.gitlab4j.api.utils.ISO8601 class
@@ -106,7 +105,7 @@ Date until = new Date(); // now
106105
List<Commit> commits = gitLabApi.getCommitsApi().getCommits(1234, "new-feature", since, until);
107106
```
108107

109-
EventsApi:
108+
### EventsApi
110109
```java
111110
// Get a list of Events for the authenticated user
112111
Date after = new Date(0); // After Eposc
@@ -115,37 +114,43 @@ List<Event> events = gitLabApi.getEventsApi().getAuthenticatedUserEvents(null, n
115114
assertNotNull(events);
116115
```
117116

118-
GroupApi:
117+
### GroupApi
119118
```java
120119
// Get a list of groups that you have access to
121120
List<Group> groups = gitLabApi.getGroupApi().getGroups();
122121
```
123122

124-
JobApi:
123+
### JobApi
125124
```java
126125
// Get a list of jobs for the specified project ID
127126
List<Job> jobs = gitLabApi.getJobApi().getJobs(1234);
128127
```
129128

130-
MergeRequestApi:
129+
### MergeRequestApi
131130
```java
132131
// Get a list of the merge requests for the specified project
133132
List<MergeRequest> mergeRequests = gitLabApi.getMergeRequestApi().getMergeRequests(1234);
134133
```
135134

136-
NamespaceApi:
135+
### NamespaceApi
137136
```java
138137
// Get all namespaces that match "foobar" in their name or path
139138
List<Namespace> namespaces = gitLabApi.getNamespaceApi().findNamespaces("foobar");
140139
```
141140

142-
PipelineApi:
141+
### NotesApi
142+
```java
143+
// Get a list of the issues's notes for project ID 1234, issue ID 1
144+
List<Note> notes = getNotes(Integer 1234, Integer 1);
145+
```
146+
147+
### PipelineApi
143148
```java
144149
// Get all pipelines for the specified project ID
145150
List<Pipeline> pipelines = gitLabApi.getPipelineApi().getPipelines(1234);
146151
```
147152

148-
ProjectApi:
153+
### ProjectApi
149154
```java
150155
// Get a list of accessible projects
151156
public List<Project> projects = gitLabApi.getProjectApi().getProjects();
@@ -164,31 +169,31 @@ Project projectSpec = new Project()
164169
Project newProject = gitLabApi.getProjectApi().createProject(projectSpec);
165170
```
166171

167-
RepositoryApi:
172+
### RepositoryApi
168173
```java
169174
// Get a list of repository branches from a project, sorted by name alphabetically
170175
List<Branch> branches = gitLabApi.getRepositoryApi().getBranches();
171176
```
172177

173-
RepositoryFileApi:
178+
### RepositoryFileApi
174179
```java
175180
// Get info (name, size, ...) and the content from a file in repository
176181
RepositoryFile file = gitLabApi.getRepositoryFileApi().getFile("file-path", 1234, "ref");
177182
```
178183

179-
ServicesApi:
184+
### ServicesApi
180185
```java
181186
// Activates the gitlab-ci service.
182187
getLabApi.getServicesApi().setGitLabCI("project-name", "auth-token", "project-ci-url");
183188
```
184189

185-
SessionApi:
190+
### SessionApi
186191
```java
187192
// Log in to the GitLab server and get the session info
188193
getLabApi.getSessionApi().login("your-username", "your-email", "your-password");
189194
```
190195

191-
UserApi:
196+
### UserApi
192197
```java
193198
// Get the User info for user_id 1
194199
User user = gitLabApi.getUserApi().getUser(1);

0 commit comments

Comments
 (0)