public class GitLabApi extends Object
Constructor and Description |
---|
GitLabApi(String hostUrl,
Session session)
Constructs a GitLabApi instance set up to interact with the GitLab server
specified by hostUrl.
|
GitLabApi(String hostUrl,
String privateToken)
Constructs a GitLabApi instance set up to interact with the GitLab server
specified by hostUrl.
|
GitLabApi(String hostUrl,
String privateToken,
String secretToken)
Constructs a GitLabApi instance set up to interact with the GitLab server
specified by hostUrl.
|
GitLabApi(String hostUrl,
String privateToken,
String secretToken,
Map<String,Object> clientConfigProperties) |
Modifier and Type | Method and Description |
---|---|
static GitLabApi |
create(String url,
String username,
String password)
Logs into GitLab using provided
username and password , and creates a new GitLabApi instance using returned private token |
CommitsApi |
getCommitsApi()
Gets the CommitsApi instance owned by this GitLabApi instance.
|
GroupApi |
getGroupApi()
Gets the GroupApi instance owned by this GitLabApi instance.
|
MergeRequestApi |
getMergeRequestApi()
Gets the MergeRequestApi instance owned by this GitLabApi instance.
|
NamespaceApi |
getNamespaceApi()
Gets the NamespaceApi instance owned by this GitLabApi instance.
|
ProjectApi |
getProjectApi()
Gets the ProjectApi instance owned by this GitLabApi instance.
|
RepositoryApi |
getRepositoryApi()
Gets the RepositoryApi instance owned by this GitLabApi instance.
|
RepositoryFileApi |
getRepositoryFileApi()
Gets the RepositoryFileApi instance owned by this GitLabApi instance.
|
ServicesApi |
getServicesApi()
Gets the ServicesApi instance owned by this GitLabApi instance.
|
Session |
getSession()
If this instance was created with
create(String, String, String) this method will
return the Session instance returned by the GitLab API on login, otherwise returns null. |
SessionApi |
getSessionApi()
Gets the SessionApi instance owned by this GitLabApi instance.
|
UserApi |
getUserApi()
Gets the UserApi instance owned by this GitLabApi instance.
|
void |
setNamespaceApi(NamespaceApi namespaceApi) |
public GitLabApi(String hostUrl, String privateToken)
hostUrl
- the URL of the GitLab serverprivateToken
- to private token to use for access to the APIpublic GitLabApi(String hostUrl, Session session)
hostUrl
- the URL of the GitLab serversession
- the Session instance obtained by logining into the GitLab serverpublic GitLabApi(String hostUrl, String privateToken, String secretToken)
hostUrl
- the URL of the GitLab serverprivateToken
- to private token to use for access to the APIsecretToken
- use this token to validate received payloadspublic static GitLabApi create(String url, String username, String password) throws GitLabApiException
username
and password
, and creates a new GitLabApi
instance using returned private tokenurl
- GitLab URLusername
- user name for which private token should be obtainedpassword
- password for a given username
GitLabApi
instance configured for a user-specific tokenGitLabApiException
- GitLabApiException if any exception occurs during executionpublic Session getSession()
create(String, String, String)
this method will
return the Session instance returned by the GitLab API on login, otherwise returns null.public CommitsApi getCommitsApi()
public MergeRequestApi getMergeRequestApi()
public NamespaceApi getNamespaceApi()
public void setNamespaceApi(NamespaceApi namespaceApi)
public GroupApi getGroupApi()
public ProjectApi getProjectApi()
public RepositoryApi getRepositoryApi()
public RepositoryFileApi getRepositoryFileApi()
public ServicesApi getServicesApi()
public SessionApi getSessionApi()
public UserApi getUserApi()
Copyright © 2017. All rights reserved.