Package com.jcabi.github
Class RtGitHub
java.lang.Object
com.jcabi.github.RtGitHub
- All Implemented Interfaces:
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.create("issue title", "issue body");
issue.comments().post("issue comment");
It is strongly recommended to use
RetryWire to avoid
accidental I/O exceptions:
GitHub github = new RtGitHub( new RtGitHub(oauthKey).entry().through(RetryWire.class) );
- Since:
- 0.1
- Suppressed Checkstyle violations:
- ClassDataAbstractionCouplingCheck (500 lines), MultipleStringLiteralsCheck (500 lines)
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jcabi.github.GitHub
GitHub.Time -
Constructor Summary
ConstructorsConstructorDescriptionRtGitHub()Public ctor, for anonymous access to GitHub.RtGitHub(com.jcabi.http.Request req) Public ctor, with a custom request.Public ctor, for authentication with OAuth2 token.Public ctor, for HTTP Basic Authentication.Public ctor, for HTTP Basic Authentication.Public ctor, for authentication with OAuth2 token.Public ctor, for anonymous access to GitHub.
Use this ctor when you want to access GitHub's API over a custom domain, other than https//api.github.com.
For instance, if you have your own instance of GitHub deployed somewhere. -
Method Summary
Modifier and TypeMethodDescriptionjakarta.json.JsonObjectemojis()Get emojis.com.jcabi.http.Requestentry()RESTful request, an entry point to the GitHub API.booleangists()Get Gists API entry point.Get gitignores.inthashCode()limits()Rate limit API entry point.markdown()Get Markdown API entry point.jakarta.json.JsonObjectmeta()Get meta information.Get Organizations API entry point.repos()Get repositories.search()Search API entry point.users()Get Users API entry point.
-
Constructor Details
-
RtGitHub
public RtGitHub()Public ctor, for anonymous access to GitHub.- Since:
- 0.4
-
RtGitHub
Public ctor, for anonymous access to GitHub.
Use this ctor when you want to access GitHub's API over a custom domain, other than https//api.github.com.
For instance, if you have your own instance of GitHub deployed somewhere.final GitHub myGitHub = new RtGitHub( URI.create("https://github.mydomain.com") );- Parameters:
domain- Your domain.
-
RtGitHub
Public ctor, for HTTP Basic Authentication.- Parameters:
user- User namepwd- Password- Since:
- 0.4
-
RtGitHub
Public ctor, for HTTP Basic Authentication. Use this ctor when you want to access GitHub's API over a custom domain, other than https//api.github.com.
For instance, if you have your own instance of GitHub deployed somewhere.final GitHub myGitHub = new RtGitHub( "john_doe", "johnspassword", URI.create("https://github.mydomain.com") );- Parameters:
user- User's username.pwd- User's password.domain- Your custom domain.
-
RtGitHub
Public ctor, for authentication with OAuth2 token. Use this ctor when you want to access GitHub's API over a custom domain, other than https//api.github.com.
For instance, if you have your own instance of GitHub deployed somewhere.final GitHub myGitHub = new RtGitHub( "john_doe", "johnspassword", URI.create("https://github.mydomain.com") );- Parameters:
token- OAuth tokendomain- Your custom domain.
-
RtGitHub
Public ctor, for authentication with OAuth2 token.- Parameters:
token- OAuth token
-
RtGitHub
public RtGitHub(com.jcabi.http.Request req) Public ctor, with a custom request.- Parameters:
req- Request to start from- Since:
- 0.4
-
-
Method Details
-
entry
public com.jcabi.http.Request entry()Description copied from interface:GitHubRESTful request, an entry point to the GitHub API. -
repos
Description copied from interface:GitHubGet repositories. -
gists
Description copied from interface:GitHubGet Gists API entry point. -
users
Description copied from interface:GitHubGet Users API entry point. -
organizations
Description copied from interface:GitHubGet Organizations API entry point.- Specified by:
organizationsin interfaceGitHub- Returns:
- Organizations API entry point
-
limits
Description copied from interface:GitHubRate limit API entry point. -
search
Description copied from interface:GitHubSearch API entry point. -
meta
Description copied from interface:GitHubGet meta information.- Specified by:
metain interfaceGitHub- Returns:
- JSON with meta
- Throws:
IOException- If there is any I/O problem- See Also:
-
emojis
Description copied from interface:GitHubGet emojis.- Specified by:
emojisin interfaceGitHub- Returns:
- JSON with emojis
- Throws:
IOException- If there is any I/O problem- See Also:
-
gitignores
Description copied from interface:GitHubGet gitignores.- Specified by:
gitignoresin interfaceGitHub- Returns:
- Gitignotes API
- See Also:
-
markdown
Description copied from interface:GitHubGet Markdown API entry point. -
equals
-
hashCode
public int hashCode()
-