Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing EventResponse.Type entries #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
* <a href="https://lichess.org/api#tag/Board/operation/apiStreamEvent">Lichess Event Stream Documentation</a>
*/
@Data
public class EventResponse {
private final Type type;
private final Challenge challenge;
@SerializedName("game")
private final GameStart gameStart;
private final Game game;

/**
* <a href="https://lichess.org/api#tag/Board/operation/apiStreamEvent">Lichess Event Stream Documentation</a>
*/
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.<br>
* Alternative to {@link Type#values()}.
*/
public static List<Type> toList() {
return Arrays.stream(Type.values()).collect(Collectors.toList());
}
}
}