@Immutable public interface Github
This is how you start communicating with Github API:
Github github = new RtGithub(oauthKey); Repo repo = github.repo("jcabi/jcabi-github"); Issues issues = repo.issues(); Issue issue = issues.post("issue title", "issue body");
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) );
The interfaces in this packages are trying to cover as much
as possible of Github API. However, there are parts of API that are
rarely used and making Java classes for them is not an effective
idea. That's why Github
class has entry()
method,
which returns an entry point to the RESTful API. For example, you
want to use
"Search
Repositories" feature of Github:
Github github = new RtGithub(oauthKey); int found = github.entry() .uri().path("/search/repositories").back() .method(Request.GET) .as(JsonResponse.class) .getJsonObject() .getNumber("total_count") .intValue();
Modifier and Type | Interface and Description |
---|---|
static class |
Github.Time
Time in Github JSON.
|
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.
|
@NotNull(message="request is never NULL") com.jcabi.http.Request entry()
@NotNull(message="list of repositories is never NULL") Repos repos()
@NotNull(message="gists is never NULL") Gists gists()
@NotNull(message="users is never NULL") Users users()
@NotNull(message="markdown API is never NULL") Markdown markdown()
@NotNull(message="rate limit API is never NULL") Limits limits()
@NotNull(message="search API is never NULL") Search search()
@NotNull(message="gitignores JSON is never NULL") Gitignores gitignores() throws IOException
IOException
- If there is any I/O problem@NotNull(message="meta JSON is never NULL") javax.json.JsonObject meta() throws IOException
IOException
- If there is any I/O problem@NotNull(message="emojis JSON is never NULL") javax.json.JsonObject emojis() throws IOException
IOException
- If there is any I/O problemCopyright © 2012–2014 jcabi.com. All rights reserved.