Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.messners.gitlab.api;


This class is provides a simplified interface to a GitLab API server, and divides the API up into a separate API class for each concern.

Author(s):
Greg Messner <greg@messners.com>
  
 public class GitLabApi {
 	
 	private CommitsApi commitsApi;
 	private GroupApi groupApi;
 	private ProjectApi projectApi;
 	private SessionApi sessoinApi;
 	private UserApi userApi;

Logs into GitLab using provided username and password, and creates a new GitLabApi instance using returned private token

Parameters:
url GitLab URL
username user name for which private token should be obtained
password password for a given username
Returns:
new GitLabApi instance configured for a user-specific token
 
 	static public GitLabApi create(String urlString usernameString passwordthrows GitLabApiException {
 		String token = new SessionApi(new GitLabApi(urlnull)).login(usernamenullpassword).getPrivateToken();
 		return new GitLabApi(urltoken);
 	}


Constructs a GitLabApi instance set up to interact with the GitLab server specified by hostUrl.

Parameters:
hostUrl
privateToken
 
 	public GitLabApi (String hostUrlString privateToken) {	
 		 = new GitLabApiClient(hostUrlprivateToken);
 		 = new CommitsApi(this);
 		 = new GroupApi(this);
 		 = new ProjectApi(this);
 		 = new RepositoryApi(this);
 		 = new SessionApi(this);
 		 = new UserApi(this);
 	}


Return the GitLabApiClient associated with this instance. This is used by all the sub API classes to communicate with the GitLab API.

Returns:
the GitLabApiClient associated with this instance
 
 		return ();
 	}


Gets the CommitsApi instance owned by this GitLabApi instance. The CommitsApi is used to perform all commit related API calls.

Returns:
the CommitsApi instance owned by this GitLabApi instance
 
 	public CommitsApi getCommitsApi () {
 		return ();		
 	}


Gets the MergeRequestApi instance owned by this GitLabApi instance. The MergeRequestApi is used to perform all merge request related API calls.

Returns:
the MergeRequestApi instance owned by this GitLabApi instance
 
 		return ();		
 	}


Gets the GroupApi instance owned by this GitLabApi instance. The GroupApi is used to perform all group related API calls.

Returns:
the GroupApi instance owned by this GitLabApi instance
 
 	public GroupApi getGroupApi () {
 		return ();		
 	}


Gets the ProjectApi instance owned by this GitLabApi instance. The ProjectApi is used to perform all project related API calls.

Returns:
the ProjectApi instance owned by this GitLabApi instance
	public ProjectApi getProjectApi () {
		return ();		
	}


Gets the RepositoryApi instance owned by this GitLabApi instance. The RepositoryApi is used to perform all repository related API calls.

Returns:
the RepositoryApi instance owned by this GitLabApi instance
		return ();		
	}	


Gets the SessionApi instance owned by this GitLabApi instance. The SessionApi is used to perform a login to the GitLab API.

Returns:
the SessionApi instance owned by this GitLabApi instance
	public SessionApi getSessionApi () {
		return ();
	}


Gets the UserApi instance owned by this GitLabApi instance. The UserApi is used to perform all user related API calls.

Returns:
the UserApi instance owned by this GitLabApi instance
	public UserApi getUserApi () {
		return ();		
	}
New to GrepCode? Check out our FAQ X