diff --git a/lichess4j/src/main/java/net/marvk/chess/lichess4j/model/EventResponse.java b/lichess4j/src/main/java/net/marvk/chess/lichess4j/model/EventResponse.java index b8c3120..3b5d0f5 100644 --- a/lichess4j/src/main/java/net/marvk/chess/lichess4j/model/EventResponse.java +++ b/lichess4j/src/main/java/net/marvk/chess/lichess4j/model/EventResponse.java @@ -3,17 +3,35 @@ import com.google.gson.annotations.SerializedName; import lombok.Data; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +/** + * Lichess Event Stream Documentation + */ @Data public class EventResponse { private final Type type; private final Challenge challenge; - @SerializedName("game") - private final GameStart gameStart; + private final Game game; + /** + * Lichess Event Stream Documentation + */ public enum Type { - @SerializedName("challenge") - CHALLENGE, - @SerializedName("gameStart") - GAME_START; + @SerializedName("challenge") CHALLENGE, + @SerializedName("challengeCanceled") CHALLENGE_CANCELED, + @SerializedName("challengeDeclined") CHALLENGE_DECLINED, + @SerializedName("gameFinish") GAME_FINISH, + @SerializedName("gameStart") GAME_START; + + /** + * Returns all values of the enum as a list.
+ * Alternative to {@link Type#values()}. + */ + public static List toList() { + return Arrays.stream(Type.values()).collect(Collectors.toList()); + } } }