|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.kohsuke.github.GitHub
public class GitHub
Root of the GitHub API.
| Method Summary | ||
|---|---|---|
static GitHub |
connect()
Obtains the credential from "~/.github" |
|
static GitHub |
connect(String login,
String oauthAccessToken)
|
|
static GitHub |
connect(String login,
String oauthAccessToken,
String password)
Deprecated. Either OAuth token or password is sufficient, so there's no point in passing both. Use connectUsingPassword(String, String) or connectUsingOAuth(String). |
|
static GitHub |
connectAnonymously()
Connects to GitHub anonymously. |
|
static GitHub |
connectToEnterprise(String apiUrl,
String oauthAccessToken)
Version that connects to GitHub Enterprise. |
|
static GitHub |
connectToEnterprise(String apiUrl,
String login,
String password)
|
|
static GitHub |
connectUsingOAuth(String oauthAccessToken)
|
|
static GitHub |
connectUsingOAuth(String githubServer,
String oauthAccessToken)
|
|
static GitHub |
connectUsingPassword(String login,
String password)
|
|
GHGistBuilder |
createGist()
|
|
GHRepository |
createRepository(String name,
String description,
String homepage,
boolean isPublic)
Creates a new repository. |
|
GHAuthorization |
createToken(Collection<String> scope,
String note,
String noteUrl)
Creates a new authorization. |
|
HttpConnector |
getConnector()
|
|
List<GHEventInfo> |
getEvents()
Public events visible to you. |
|
GHGist |
getGist(String id)
Gets a sigle gist by ID. |
|
Map<String,GHOrganization> |
getMyOrganizations()
This method returns a shallowly populated organizations. |
|
GHMyself |
getMyself()
Gets the GHUser that represents yourself. |
|
GHOrganization |
getOrganization(String name)
|
|
GHRateLimit |
getRateLimit()
Gets the current rate limit. |
|
GHRepository |
getRepository(String name)
Gets the repository object from 'user/reponame' string that GitHub calls as "repository name" |
|
protected GHUser |
getUser(GHUser orig)
Interns the given GHUser. |
|
GHUser |
getUser(String login)
Obtains the object that represents the named user. |
|
boolean |
isAnonymous()
Is this an anonymous connection |
|
boolean |
isCredentialValid()
Ensures that the credential is valid. |
|
|
parseEventPayload(Reader r,
Class<T> type)
Parses the GitHub event object. |
|
void |
setConnector(HttpConnector connector)
Sets the custom connector used to make requests to GitHub. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static GitHub connect()
throws IOException
IOException
public static GitHub connectToEnterprise(String apiUrl,
String oauthAccessToken)
throws IOException
apiUrl - The URL of GitHub (or GitHub enterprise) API endpoint, such as "https://api.github.com" or
"http://ghe.acme.com/api/v3". Note that GitHub Enterprise has /api/v3 in the URL.
For historical reasons, this parameter still accepts the bare domain name, but that's considered deprecated.
IOException
public static GitHub connectToEnterprise(String apiUrl,
String login,
String password)
throws IOException
IOException
public static GitHub connect(String login,
String oauthAccessToken)
throws IOException
IOException
public static GitHub connect(String login,
String oauthAccessToken,
String password)
throws IOException
connectUsingPassword(String, String) or connectUsingOAuth(String).
IOException
public static GitHub connectUsingPassword(String login,
String password)
throws IOException
IOException
public static GitHub connectUsingOAuth(String oauthAccessToken)
throws IOException
IOException
public static GitHub connectUsingOAuth(String githubServer,
String oauthAccessToken)
throws IOException
IOException
public static GitHub connectAnonymously()
throws IOException
IOExceptionpublic boolean isAnonymous()
true if operations that require authentication will fail.public HttpConnector getConnector()
public void setConnector(HttpConnector connector)
public GHRateLimit getRateLimit()
throws IOException
IOException
@WithBridgeMethods(value=GHUser.class)
public GHMyself getMyself()
throws IOException
GHUser that represents yourself.
IOException
public GHUser getUser(String login)
throws IOException
IOException
protected GHUser getUser(GHUser orig)
throws IOException
GHUser.
IOException
public GHOrganization getOrganization(String name)
throws IOException
IOException
public GHRepository getRepository(String name)
throws IOException
IOExceptionGHRepository.getName()
public Map<String,GHOrganization> getMyOrganizations()
throws IOException
getOrganization(String)
TODO: make this automatic.
IOException
public List<GHEventInfo> getEvents()
throws IOException
IOException
public GHGist getGist(String id)
throws IOException
IOExceptionpublic GHGistBuilder createGist()
public <T extends GHEventPayload> T parseEventPayload(Reader r,
Class<T> type)
throws IOException
IOException
public GHRepository createRepository(String name,
String description,
String homepage,
boolean isPublic)
throws IOException
GHOrganization.createRepository(String, String, String, GHTeam, boolean)
IOException
public GHAuthorization createToken(Collection<String> scope,
String note,
String noteUrl)
throws IOException
connectUsingOAuth(String) in the future.
IOException
public boolean isCredentialValid()
throws IOException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||