diff --git a/src/main/java/discord4j/discordjson/json/gateway/PollVoteAdd.java b/src/main/java/discord4j/discordjson/json/gateway/PollVoteAdd.java new file mode 100644 index 00000000..f6d6f6a5 --- /dev/null +++ b/src/main/java/discord4j/discordjson/json/gateway/PollVoteAdd.java @@ -0,0 +1,32 @@ +/* + * This file is part of Discord4J. + * + * Discord4J is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Discord4J is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Discord4J. If not, see . + */ +package discord4j.discordjson.json.gateway; + +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.immutables.value.Value; + +@Value.Immutable(builder = false) +@JsonSerialize(as = ImmutablePollVoteAdd.class) +@JsonDeserialize(as = ImmutablePollVoteAdd.class) +public interface PollVoteAdd extends Dispatch { + + @JsonUnwrapped + PollVoteData data(); + +} diff --git a/src/main/java/discord4j/discordjson/json/gateway/PollVoteData.java b/src/main/java/discord4j/discordjson/json/gateway/PollVoteData.java new file mode 100644 index 00000000..e0901b2b --- /dev/null +++ b/src/main/java/discord4j/discordjson/json/gateway/PollVoteData.java @@ -0,0 +1,47 @@ +/* + * This file is part of Discord4J. + * + * Discord4J is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Discord4J is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Discord4J. If not, see . + */ +package discord4j.discordjson.json.gateway; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import discord4j.discordjson.Id; +import org.immutables.value.Value; + +import java.util.Optional; + +@Value.Immutable(builder = false) +@JsonSerialize(as = ImmutablePollVoteAdd.class) +@JsonDeserialize(as = ImmutablePollVoteAdd.class) +public interface PollVoteData { + + @JsonProperty("user_id") + Id userId(); + + @JsonProperty("channel_id") + Id channelId(); + + @JsonProperty("message_id") + Id messageId(); + + @JsonProperty("guild_id") + Optional guildId(); + + @JsonProperty("answer_id") + int answerId(); + +} diff --git a/src/main/java/discord4j/discordjson/json/gateway/PollVoteRemove.java b/src/main/java/discord4j/discordjson/json/gateway/PollVoteRemove.java new file mode 100644 index 00000000..94f55381 --- /dev/null +++ b/src/main/java/discord4j/discordjson/json/gateway/PollVoteRemove.java @@ -0,0 +1,32 @@ +/* + * This file is part of Discord4J. + * + * Discord4J is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Discord4J is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with Discord4J. If not, see . + */ +package discord4j.discordjson.json.gateway; + +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.immutables.value.Value; + +@Value.Immutable(builder = false) +@JsonSerialize(as = ImmutablePollVoteRemove.class) +@JsonDeserialize(as = ImmutablePollVoteRemove.class) +public interface PollVoteRemove extends Dispatch { + + @JsonUnwrapped + PollVoteData data(); + +}