@Immutable @Loggable(value=1) public final class RtGithub extends Object implements Github
This is how you start communicating with Github API:
Github github = new RtGithub(oauthKey); Repo repo = github.repos().get( new Coordinates.Simple("jcabi/jcabi-github") ); Issues issues = repo.issues(); Issue issue = issues.create("issue title", "issue body"); issue.comments().post("issue comment");
It is strongly recommended to use
com.jcabi.http.wire.RetryWire
to avoid
accidental I/O exceptions:
Github github = new RtGithub( new RtGithub(oauthKey).entry().through(RetryWire.class) );
Github.Time
Constructor and Description |
---|
RtGithub()
Public ctor, for anonymous access to Github.
|
RtGithub(com.jcabi.http.Request req)
Public ctor, with a custom request.
|
RtGithub(String token)
Public ctor, for authentication with OAuth2 token.
|
RtGithub(String user,
String pwd)
Public ctor, for HTTP Basic Authentication.
|
Modifier and Type | Method and Description |
---|---|
javax.json.JsonObject |
emojis()
Get emojis.
|
com.jcabi.http.Request |
entry()
RESTful request, an entry point to the Github API.
|
Gists |
gists()
Get Gists API entry point.
|
Gitignores |
gitignores()
Get gitignores.
|
Limits |
limits()
Rate limit API entry point.
|
Markdown |
markdown()
Get Markdown API entry point.
|
javax.json.JsonObject |
meta()
Get meta information.
|
Repos |
repos()
Get repositories.
|
Search |
search()
Search API entry point.
|
Users |
users()
Get Users API entry point.
|
public RtGithub()
public RtGithub(@NotNull(message="user name can\'t be NULL") String user, @NotNull(message="password can\'t be NULL") String pwd)
user
- User namepwd
- Passwordpublic RtGithub(@NotNull(message="token can\'t be NULL") String token)
token
- OAuth token@NotNull(message="request can\'t be NULL") public com.jcabi.http.Request entry()
Github
@NotNull(message="repos is never NULL") public Repos repos()
Github
@NotNull(message="gists are never NULL") public Gists gists()
Github
@NotNull(message="users are never NULL") public Users users()
Github
@NotNull(message="limmits can\'t be NULL") public Limits limits()
Github
@NotNull(message="search is never NULL") public Search search()
Github
@NotNull(message="JSON is never NULL") public javax.json.JsonObject meta() throws IOException
Github
meta
in interface Github
IOException
- If there is any I/O problem@NotNull(message="JSON is never NULL") public javax.json.JsonObject emojis() throws IOException
Github
emojis
in interface Github
IOException
- If there is any I/O problem@NotNull(message="GitIgnores is never NULL") public Gitignores gitignores() throws IOException
Github
gitignores
in interface Github
IOException
- If there is any I/O problemCopyright © 2012–2014 jcabi.com. All rights reserved.