diff --git a/src/main/java/org/kohsuke/github/GHPerson.java b/src/main/java/org/kohsuke/github/GHPerson.java index f1bba9624b..ce395e0487 100644 --- a/src/main/java/org/kohsuke/github/GHPerson.java +++ b/src/main/java/org/kohsuke/github/GHPerson.java @@ -24,10 +24,10 @@ public abstract class GHPerson extends GHObject { protected String login, avatar_url; // other fields (that only show up in full data) - protected String location, blog, email, name, company, type; + protected String location, blog, email, bio, name, company, type, twitter_username; protected String html_url; protected int followers, following, public_repos, public_gists; - protected boolean site_admin; + protected boolean site_admin, hireable; // other fields (that only show up in full data) that require privileged scope protected Integer total_private_repos; @@ -213,6 +213,18 @@ public String getName() throws IOException { return name; } + /** + * Gets the bio of this user, like "I am a developer and love to code!" + * + * @return the bio + * @throws IOException + * the io exception + */ + public String getBio() throws IOException { + populate(); + return bio; + } + /** * Gets the company name of this user, like "Sun Microsystems, Inc." * @@ -237,6 +249,18 @@ public String getLocation() throws IOException { return location; } + /** + * Gets the Twitter Username of this user, like "GitHub" + * + * @return the Twitter username + * @throws IOException + * the io exception + */ + public String getTwitterUsername() throws IOException { + populate(); + return twitter_username; + } + public Date getCreatedAt() throws IOException { populate(); return super.getCreatedAt(); @@ -348,6 +372,18 @@ public boolean isSiteAdmin() throws IOException { return site_admin; } + /** + * Gets the hireable field + * + * @return the hireable field + * @throws IOException + * the io exception + */ + public boolean isHireable() throws IOException { + populate(); + return hireable; + } + /** * Gets total private repo count. * diff --git a/src/test/java/org/kohsuke/github/GHObjectTest.java b/src/test/java/org/kohsuke/github/GHObjectTest.java index b960bf6ddf..f6cda3a1da 100644 --- a/src/test/java/org/kohsuke/github/GHObjectTest.java +++ b/src/test/java/org/kohsuke/github/GHObjectTest.java @@ -11,7 +11,7 @@ public void test_toString() throws Exception { GHOrganization org = gitHub.getOrganization(GITHUB_API_TEST_ORG); assertThat(org.toString(), containsString( - "login=hub4j-test-org,location=,blog=,email=,name=,company=,type=Organization,followers=0,following=0")); + "login=hub4j-test-org,location=,blog=,email=,bio=,name=,company=,type=Organization,followers=0,following=0,hireable=false")); // getResponseHeaderFields is deprecated but we should not break it. assertThat(org.getResponseHeaderFields(), notNullValue());