diff --git a/src/main/java/com/github/shredder121/gh_event_api/model/Comment.java b/src/main/java/com/github/shredder121/gh_event_api/model/Comment.java index 691faa7..c16971a 100644 --- a/src/main/java/com/github/shredder121/gh_event_api/model/Comment.java +++ b/src/main/java/com/github/shredder121/gh_event_api/model/Comment.java @@ -17,9 +17,11 @@ import java.time.ZonedDateTime; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy; import com.fasterxml.jackson.databind.annotation.JsonNaming; import com.github.shredder121.gh_event_api.model.json.PropertyBasedJsonCreator; +import com.google.common.collect.ImmutableMap; /** * A comment on a part of the commit diff. @@ -87,6 +89,11 @@ public class Comment { */ String htmlUrl; + /** + * The user that created the comment. + */ + User user; + /** * The time the comment was created. */ @@ -96,4 +103,11 @@ public class Comment { * The time the comment was last modified. */ ZonedDateTime updatedAt; + + /** + * Additional links included in the Comment. + * (Only populated with pull request review comments) + */ + @JsonProperty("_links") + ImmutableMap links; } diff --git a/src/main/java/com/github/shredder121/gh_event_api/model/Deployment.java b/src/main/java/com/github/shredder121/gh_event_api/model/Deployment.java index 9c6106e..4a97075 100644 --- a/src/main/java/com/github/shredder121/gh_event_api/model/Deployment.java +++ b/src/main/java/com/github/shredder121/gh_event_api/model/Deployment.java @@ -40,6 +40,21 @@ public class Deployment { */ Integer id; + /** + * The (API) URL of this deployment. + */ + String url; + + /** + * The (API) URL to view this deployment's statuses. + */ + String statusesUrl; + + /** + * The (API) URL to view the repository this deployment is for. + */ + String repositoryUrl; + /** * The ref to deploy. * This can be a branch, tag or SHA. diff --git a/src/main/java/com/github/shredder121/gh_event_api/model/Repository.java b/src/main/java/com/github/shredder121/gh_event_api/model/Repository.java index f5ed512..57c400c 100644 --- a/src/main/java/com/github/shredder121/gh_event_api/model/Repository.java +++ b/src/main/java/com/github/shredder121/gh_event_api/model/Repository.java @@ -15,6 +15,9 @@ */ package com.github.shredder121.gh_event_api.model; +import java.time.ZonedDateTime; + +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy; import com.fasterxml.jackson.databind.annotation.JsonNaming; import com.github.shredder121.gh_event_api.model.json.PropertyBasedJsonCreator; @@ -30,6 +33,11 @@ ) public class Repository { + /** + * The id of this repository. + */ + Integer id; + /** * The name of the repository. */ @@ -40,6 +48,26 @@ public class Repository { */ String fullName; + /** + * The description of the repository. + */ + String description; + + /** + * The default branch of the repository. + */ + String defaultBranch; + + /** + * The homepage of the repository. + */ + String homepage; + + /** + * The most prevalent language that + */ + String language; + /** * The owner of the repository */ @@ -54,4 +82,41 @@ public class Repository { * How many forks there are currently. */ Long forks; + + /** + * Whether this repository is a fork of another repository. + */ + @JsonProperty("fork") + boolean isFork; + + /** + * Whether this repository is a private repository. + */ + @JsonProperty("private") + boolean isPrivate; + + /** + * The (API) URL to view this repository. + */ + String url; + + /** + * The (GitHub Web UI) URL to view this repository. + */ + String htmlUrl; + + /** + * The time this repository was created. + */ + ZonedDateTime createdAt; + + /** + * The time this repository was last updated. + */ + ZonedDateTime updatedAt; + + /** + * The time the repository was last pushed to. + */ + ZonedDateTime pushedAt; } diff --git a/src/main/java/com/github/shredder121/gh_event_api/model/User.java b/src/main/java/com/github/shredder121/gh_event_api/model/User.java index 0ba592e..c36c454 100644 --- a/src/main/java/com/github/shredder121/gh_event_api/model/User.java +++ b/src/main/java/com/github/shredder121/gh_event_api/model/User.java @@ -15,6 +15,7 @@ */ package com.github.shredder121.gh_event_api.model; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.PropertyNamingStrategy.LowerCaseWithUnderscoresStrategy; import com.fasterxml.jackson.databind.annotation.JsonNaming; import com.github.shredder121.gh_event_api.model.json.PropertyBasedJsonCreator; @@ -51,4 +52,17 @@ public class User { * The (GitHub Web UI) URL to view this user. */ String htmlUrl; + + /** + * The type of User. + * (Payloads can be sent from {@code User}s or {@code Organization}s) + */ + String type; + + /** + * Whether the user is the administrator. + * (On GitHub.com this means a GitHub employee) + */ + @JsonProperty("site_admin") + boolean isSiteAdmin; } diff --git a/src/test/java/com/github/shredder121/gh_event_api/testutil/HamcrestHelpers.java b/src/test/java/com/github/shredder121/gh_event_api/testutil/HamcrestHelpers.java index c38dcfd..f655f54 100644 --- a/src/test/java/com/github/shredder121/gh_event_api/testutil/HamcrestHelpers.java +++ b/src/test/java/com/github/shredder121/gh_event_api/testutil/HamcrestHelpers.java @@ -107,7 +107,8 @@ private BaxterTheHacker() { public static final Matcher BAXTERTHEHACKER = allOf(asList( property(User::getId, is(6752317)), property(User::getLogin, is("baxterthehacker")), - property(User::getHtmlUrl, is("https://github.com/baxterthehacker")) + property(User::getHtmlUrl, is("https://github.com/baxterthehacker")), + property(User::isSiteAdmin, is(false)) )); public static final Matcher BAXTERTHEHACKER_PUBLIC_REPO = allOf(asList( @@ -125,7 +126,8 @@ private JasonRudolph() { public static final Matcher JASONRUDOLPH = allOf(asList( property(User::getId, is(2988)), property(User::getLogin, is("jasonrudolph")), - property(User::getHtmlUrl, is("https://github.com/jasonrudolph")) + property(User::getHtmlUrl, is("https://github.com/jasonrudolph")), + property(User::isSiteAdmin, is(true)) )); } @@ -137,7 +139,8 @@ private Kdaigle() { public static final Matcher KDAIGLE = allOf(asList( property(User::getId, is(2501)), property(User::getLogin, is("kdaigle")), - property(User::getHtmlUrl, is("https://github.com/kdaigle")) + property(User::getHtmlUrl, is("https://github.com/kdaigle")), + property(User::isSiteAdmin, is(true)) )); }