Package com.jcabi.github
Interface Github
-
@Immutable public interface Github
Github client, starting point to the entire library.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.post("issue title", "issue body");It is strongly recommended to use
RetryWireto 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
Githubclass hasentry()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) .fetch() .as(JsonResponse.class) .getJsonObject() .getNumber("total_count") .intValue();- Since:
- 0.1
- Version:
- $Id: e1973b8ea19286ba8e38633a0fd1f01eee56e6e6 $
- Author:
- Yegor Bugayenko (yegor256@gmail.com)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classGithub.TimeTime in Github JSON.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description javax.json.JsonObjectemojis()Get emojis.com.jcabi.http.Requestentry()RESTful request, an entry point to the Github API.Gistsgists()Get Gists API entry point.Gitignoresgitignores()Get gitignores.Limitslimits()Rate limit API entry point.Markdownmarkdown()Get Markdown API entry point.javax.json.JsonObjectmeta()Get meta information.Organizationsorganizations()Get Organizations API entry point.Reposrepos()Get repositories.Searchsearch()Search API entry point.Usersusers()Get Users API entry point.
-
-
-
Method Detail
-
entry
com.jcabi.http.Request entry()
RESTful request, an entry point to the Github API.- Returns:
- Request
-
repos
Repos repos()
Get repositories.- Returns:
- Repositories
-
gists
Gists gists()
Get Gists API entry point.- Returns:
- Gists API entry point
-
users
Users users()
Get Users API entry point.- Returns:
- Users API entry point
- Since:
- 0.4
-
organizations
Organizations organizations()
Get Organizations API entry point.- Returns:
- Organizations API entry point
- Since:
- 0.24
-
markdown
Markdown markdown()
Get Markdown API entry point.- Returns:
- Markdown API entry point
- Since:
- 0.6
-
limits
Limits limits()
Rate limit API entry point.- Returns:
- Rate limit API
- Since:
- 0.6
-
search
Search search()
Search API entry point.- Returns:
- Search API
- Since:
- 0.8
-
gitignores
Gitignores gitignores() throws IOException
Get gitignores.- Returns:
- Gitignotes API
- Throws:
IOException- If there is any I/O problem- Since:
- 0.8
- See Also:
- Gitignore API
-
meta
javax.json.JsonObject meta() throws IOExceptionGet meta information.- Returns:
- JSON with meta
- Throws:
IOException- If there is any I/O problem- Since:
- 0.6
- See Also:
- Meta API
-
emojis
javax.json.JsonObject emojis() throws IOExceptionGet emojis.- Returns:
- JSON with emojis
- Throws:
IOException- If there is any I/O problem- Since:
- 0.6
- See Also:
- Emojis API
-
-