Commit 9cac3b04 authored by Greg Messner's avatar Greg Messner Committed by GitHub
Browse files

Added links to sub APIs.

parent 83184f99
...@@ -77,27 +77,26 @@ The API has been broken up into sub APIs classes to make it easier to learn and ...@@ -77,27 +77,26 @@ The API has been broken up into sub APIs classes to make it easier to learn and
Available Sub APIs Available Sub APIs
------------------ ------------------
``` &nbsp;&nbsp;[CommitsApi](#commitsapi)<br/>
CommitsApi &nbsp;&nbsp;[EventsApi](#eventsapi)<br/>
EventsApi &nbsp;&nbsp;[GroupApi](#groupapi)<br/>
GroupApi &nbsp;&nbsp;[JobApi](#jobapi)<br/>
JobApi &nbsp;&nbsp;[MergeRequestApi](#mergerequestapi)<br/>
MergeRequestApi &nbsp;&nbsp;[NamespaceApi](#namespaceapi)<br/>
NamespaceApi &nbsp;&nbsp;[NotesApi](#notesapi)<br/>
NotesApi &nbsp;&nbsp;[PipelineApi](#pipelineapi)<br/>
PipelineApi &nbsp;&nbsp;[ProjectApi](#projectapi)<br/>
ProjectApi &nbsp;&nbsp;[RepositoryApi](#repositoryapi)<br/>
RepositoryApi &nbsp;&nbsp;[RepositoryFileApi](#repositoryfileapi)<br/>
RepositoryFileApi &nbsp;&nbsp;[ServicesApi](#servicesapi)<br/>
ServicesApi &nbsp;&nbsp;[SessionApi](#sessionapi)<br/>
SessionApi &nbsp;&nbsp;[UserApi](#userapi)
UserApi
```
Sub API Examples Sub API Examples
---------------- ----------------
CommitsApi: ### CommitsApi
```java ```java
// Get a list of commits associated with the specified branch that fall within the specified time window // Get a list of commits associated with the specified branch that fall within the specified time window
// This uses the ISO8601 date utilities the in org.gitlab4j.api.utils.ISO8601 class // This uses the ISO8601 date utilities the in org.gitlab4j.api.utils.ISO8601 class
...@@ -106,7 +105,7 @@ Date until = new Date(); // now ...@@ -106,7 +105,7 @@ Date until = new Date(); // now
List<Commit> commits = gitLabApi.getCommitsApi().getCommits(1234, "new-feature", since, until); List<Commit> commits = gitLabApi.getCommitsApi().getCommits(1234, "new-feature", since, until);
``` ```
EventsApi: ### EventsApi
```java ```java
// Get a list of Events for the authenticated user // Get a list of Events for the authenticated user
Date after = new Date(0); // After Eposc Date after = new Date(0); // After Eposc
...@@ -115,37 +114,43 @@ List<Event> events = gitLabApi.getEventsApi().getAuthenticatedUserEvents(null, n ...@@ -115,37 +114,43 @@ List<Event> events = gitLabApi.getEventsApi().getAuthenticatedUserEvents(null, n
assertNotNull(events); assertNotNull(events);
``` ```
GroupApi: ### GroupApi
```java ```java
// Get a list of groups that you have access to // Get a list of groups that you have access to
List<Group> groups = gitLabApi.getGroupApi().getGroups(); List<Group> groups = gitLabApi.getGroupApi().getGroups();
``` ```
JobApi: ### JobApi
```java ```java
// Get a list of jobs for the specified project ID // Get a list of jobs for the specified project ID
List<Job> jobs = gitLabApi.getJobApi().getJobs(1234); List<Job> jobs = gitLabApi.getJobApi().getJobs(1234);
``` ```
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
List<MergeRequest> mergeRequests = gitLabApi.getMergeRequestApi().getMergeRequests(1234); List<MergeRequest> mergeRequests = gitLabApi.getMergeRequestApi().getMergeRequests(1234);
``` ```
NamespaceApi: ### NamespaceApi
```java ```java
// Get all namespaces that match "foobar" in their name or path // Get all namespaces that match "foobar" in their name or path
List<Namespace> namespaces = gitLabApi.getNamespaceApi().findNamespaces("foobar"); List<Namespace> namespaces = gitLabApi.getNamespaceApi().findNamespaces("foobar");
``` ```
PipelineApi: ### NotesApi
```java
// Get a list of the issues's notes for project ID 1234, issue ID 1
List<Note> notes = getNotes(Integer 1234, Integer 1);
```
### PipelineApi
```java ```java
// Get all pipelines for the specified project ID // Get all pipelines for the specified project ID
List<Pipeline> pipelines = gitLabApi.getPipelineApi().getPipelines(1234); List<Pipeline> pipelines = gitLabApi.getPipelineApi().getPipelines(1234);
``` ```
ProjectApi: ### ProjectApi
```java ```java
// Get a list of accessible projects // Get a list of accessible projects
public List<Project> projects = gitLabApi.getProjectApi().getProjects(); public List<Project> projects = gitLabApi.getProjectApi().getProjects();
...@@ -164,31 +169,31 @@ Project projectSpec = new Project() ...@@ -164,31 +169,31 @@ Project projectSpec = new Project()
Project newProject = gitLabApi.getProjectApi().createProject(projectSpec); Project newProject = gitLabApi.getProjectApi().createProject(projectSpec);
``` ```
RepositoryApi: ### RepositoryApi
```java ```java
// Get a list of repository branches from a project, sorted by name alphabetically // Get a list of repository branches from a project, sorted by name alphabetically
List<Branch> branches = gitLabApi.getRepositoryApi().getBranches(); List<Branch> branches = gitLabApi.getRepositoryApi().getBranches();
``` ```
RepositoryFileApi: ### RepositoryFileApi
```java ```java
// Get info (name, size, ...) and the content from a file in repository // Get info (name, size, ...) and the content from a file in repository
RepositoryFile file = gitLabApi.getRepositoryFileApi().getFile("file-path", 1234, "ref"); RepositoryFile file = gitLabApi.getRepositoryFileApi().getFile("file-path", 1234, "ref");
``` ```
ServicesApi: ### ServicesApi
```java ```java
// Activates the gitlab-ci service. // Activates the gitlab-ci service.
getLabApi.getServicesApi().setGitLabCI("project-name", "auth-token", "project-ci-url"); getLabApi.getServicesApi().setGitLabCI("project-name", "auth-token", "project-ci-url");
``` ```
SessionApi: ### SessionApi
```java ```java
// Log in to the GitLab server and get the session info // Log in to the GitLab server and get the session info
getLabApi.getSessionApi().login("your-username", "your-email", "your-password"); getLabApi.getSessionApi().login("your-username", "your-email", "your-password");
``` ```
UserApi: ### UserApi
```java ```java
// Get the User info for user_id 1 // Get the User info for user_id 1
User user = gitLabApi.getUserApi().getUser(1); User user = gitLabApi.getUserApi().getUser(1);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment