diff --git a/src/main/java/discord4j/discordjson/json/SendSoundboardSoundRequest.java b/src/main/java/discord4j/discordjson/json/SendSoundboardSoundRequest.java new file mode 100644 index 00000000..22063e6e --- /dev/null +++ b/src/main/java/discord4j/discordjson/json/SendSoundboardSoundRequest.java @@ -0,0 +1,25 @@ +package discord4j.discordjson.json; + +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 discord4j.discordjson.possible.Possible; +import org.immutables.value.Value; + +@Value.Immutable +@JsonSerialize(as = ImmutableSendSoundboardSoundRequest.class) +@JsonDeserialize(as = ImmutableSendSoundboardSoundRequest.class) +public interface SendSoundboardSoundRequest { + + static ImmutableSendSoundboardSoundRequest.Builder builder() { + return ImmutableSendSoundboardSoundRequest.builder(); + } + + @JsonProperty("sound_id") + Id soundId(); + + @JsonProperty("source_guild_id") + Possible sourceGuildId(); + +} diff --git a/src/main/java/discord4j/discordjson/json/SoundboardSoundCreateRequest.java b/src/main/java/discord4j/discordjson/json/SoundboardSoundCreateRequest.java new file mode 100644 index 00000000..ab8d1e58 --- /dev/null +++ b/src/main/java/discord4j/discordjson/json/SoundboardSoundCreateRequest.java @@ -0,0 +1,32 @@ +package discord4j.discordjson.json; + +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 discord4j.discordjson.possible.Possible; +import java.util.Optional; +import org.immutables.value.Value; + +@Value.Immutable +@JsonSerialize(as = ImmutableSoundboardSoundCreateRequest.class) +@JsonDeserialize(as = ImmutableSoundboardSoundCreateRequest.class) +public interface SoundboardSoundCreateRequest { + + static ImmutableSoundboardSoundCreateRequest.Builder builder() { + return ImmutableSoundboardSoundCreateRequest.builder(); + } + + String name(); + + String sound(); + + Possible> volume(); + + @JsonProperty("emoji_id") + Possible> emojiId(); + + @JsonProperty("emoji_name") + Possible> emojiName(); + +} diff --git a/src/main/java/discord4j/discordjson/json/SoundboardSoundData.java b/src/main/java/discord4j/discordjson/json/SoundboardSoundData.java new file mode 100644 index 00000000..c004f864 --- /dev/null +++ b/src/main/java/discord4j/discordjson/json/SoundboardSoundData.java @@ -0,0 +1,41 @@ +package discord4j.discordjson.json; + + +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 discord4j.discordjson.possible.Possible; +import java.util.Optional; +import org.immutables.value.Value; + +@Value.Immutable +@JsonSerialize(as = ImmutableSoundboardSoundData.class) +@JsonDeserialize(as = ImmutableSoundboardSoundData.class) +public interface SoundboardSoundData { + + static ImmutableSoundboardSoundData.Builder builder() { + return ImmutableSoundboardSoundData.builder(); + } + + String name(); + + @JsonProperty("sound_id") + Id soundId(); + + double volume(); + + @JsonProperty("emoji_id") + Optional emojiId(); + + @JsonProperty("emoji_name") + Optional emojiName(); + + @JsonProperty("guild_id") + Possible guildId(); + + boolean available(); + + Possible user(); + +} diff --git a/src/main/java/discord4j/discordjson/json/SoundboardSoundDataList.java b/src/main/java/discord4j/discordjson/json/SoundboardSoundDataList.java new file mode 100644 index 00000000..1a3efdae --- /dev/null +++ b/src/main/java/discord4j/discordjson/json/SoundboardSoundDataList.java @@ -0,0 +1,19 @@ +package discord4j.discordjson.json; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import java.util.List; +import org.immutables.value.Value; + +@Value.Immutable +@JsonSerialize(as = ImmutableSoundboardSoundDataList.class) +@JsonDeserialize(as = ImmutableSoundboardSoundDataList.class) +public interface SoundboardSoundDataList { + + static ImmutableSoundboardSoundDataList.Builder builder() { + return ImmutableSoundboardSoundDataList.builder(); + } + + List items(); + +} diff --git a/src/main/java/discord4j/discordjson/json/SoundboardSoundModifyRequest.java b/src/main/java/discord4j/discordjson/json/SoundboardSoundModifyRequest.java new file mode 100644 index 00000000..0c5a9f73 --- /dev/null +++ b/src/main/java/discord4j/discordjson/json/SoundboardSoundModifyRequest.java @@ -0,0 +1,32 @@ +package discord4j.discordjson.json; + +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 discord4j.discordjson.possible.Possible; +import java.util.Optional; +import org.immutables.value.Value; + +@Value.Immutable +@JsonSerialize(as = ImmutableSoundboardSoundModifyRequest.class) +@JsonDeserialize(as = ImmutableSoundboardSoundModifyRequest.class) +public interface SoundboardSoundModifyRequest { + + static ImmutableSoundboardSoundModifyRequest.Builder builder() { + return ImmutableSoundboardSoundModifyRequest.builder(); + } + + Possible name(); + + Possible sound(); + + Possible> volume(); + + @JsonProperty("emoji_id") + Possible> emojiId(); + + @JsonProperty("emoji_name") + Possible> emojiName(); + +} diff --git a/src/main/java/discord4j/discordjson/json/gateway/GuildSoundboardSoundCreate.java b/src/main/java/discord4j/discordjson/json/gateway/GuildSoundboardSoundCreate.java new file mode 100644 index 00000000..e41c8177 --- /dev/null +++ b/src/main/java/discord4j/discordjson/json/gateway/GuildSoundboardSoundCreate.java @@ -0,0 +1,21 @@ +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 discord4j.discordjson.json.SoundboardSoundData; +import org.immutables.value.Value; + +@Value.Immutable +@JsonSerialize(as = ImmutableGuildSoundboardSoundCreate.class) +@JsonDeserialize(as = ImmutableGuildSoundboardSoundCreate.class) +public interface GuildSoundboardSoundCreate extends Dispatch { + + static ImmutableGuildSoundboardSoundCreate.Builder builder() { + return ImmutableGuildSoundboardSoundCreate.builder(); + } + + @JsonUnwrapped + SoundboardSoundData soundboardSound(); + +} diff --git a/src/main/java/discord4j/discordjson/json/gateway/GuildSoundboardSoundDelete.java b/src/main/java/discord4j/discordjson/json/gateway/GuildSoundboardSoundDelete.java new file mode 100644 index 00000000..b3f2ba51 --- /dev/null +++ b/src/main/java/discord4j/discordjson/json/gateway/GuildSoundboardSoundDelete.java @@ -0,0 +1,24 @@ +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; + +@Value.Immutable +@JsonSerialize(as = ImmutableGuildSoundboardSoundDelete.class) +@JsonDeserialize(as = ImmutableGuildSoundboardSoundDelete.class) +public interface GuildSoundboardSoundDelete extends Dispatch { + + static ImmutableGuildSoundboardSoundDelete.Builder builder() { + return ImmutableGuildSoundboardSoundDelete.builder(); + } + + @JsonProperty("sound_id") + Id soundId(); + + @JsonProperty("guild_id") + Id guildId(); + +} diff --git a/src/main/java/discord4j/discordjson/json/gateway/GuildSoundboardSoundUpdate.java b/src/main/java/discord4j/discordjson/json/gateway/GuildSoundboardSoundUpdate.java new file mode 100644 index 00000000..b01dc277 --- /dev/null +++ b/src/main/java/discord4j/discordjson/json/gateway/GuildSoundboardSoundUpdate.java @@ -0,0 +1,21 @@ +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 discord4j.discordjson.json.SoundboardSoundData; +import org.immutables.value.Value; + +@Value.Immutable +@JsonSerialize(as = ImmutableGuildSoundboardSoundUpdate.class) +@JsonDeserialize(as = ImmutableGuildSoundboardSoundUpdate.class) +public interface GuildSoundboardSoundUpdate extends Dispatch { + + static ImmutableGuildSoundboardSoundUpdate.Builder builder() { + return ImmutableGuildSoundboardSoundUpdate.builder(); + } + + @JsonUnwrapped + SoundboardSoundData soundboardSound(); + +} diff --git a/src/main/java/discord4j/discordjson/json/gateway/GuildSoundboardSoundsUpdate.java b/src/main/java/discord4j/discordjson/json/gateway/GuildSoundboardSoundsUpdate.java new file mode 100644 index 00000000..7bf2dc62 --- /dev/null +++ b/src/main/java/discord4j/discordjson/json/gateway/GuildSoundboardSoundsUpdate.java @@ -0,0 +1,26 @@ +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 discord4j.discordjson.json.SoundboardSoundData; +import java.util.List; +import org.immutables.value.Value; + +@Value.Immutable +@JsonSerialize(as = ImmutableGuildSoundboardSoundsUpdate.class) +@JsonDeserialize(as = ImmutableGuildSoundboardSoundsUpdate.class) +public interface GuildSoundboardSoundsUpdate extends Dispatch { + + static ImmutableGuildSoundboardSoundsUpdate.Builder builder() { + return ImmutableGuildSoundboardSoundsUpdate.builder(); + } + + @JsonProperty("soundboard_sounds") + List soundboardSounds(); + + @JsonProperty("guild_id") + Id guildId(); + +} diff --git a/src/main/java/discord4j/discordjson/json/gateway/RequestSoundboardSounds.java b/src/main/java/discord4j/discordjson/json/gateway/RequestSoundboardSounds.java new file mode 100644 index 00000000..3fe0a4bf --- /dev/null +++ b/src/main/java/discord4j/discordjson/json/gateway/RequestSoundboardSounds.java @@ -0,0 +1,22 @@ +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 java.util.List; +import org.immutables.value.Value; + +@Value.Immutable +@JsonSerialize(as = ImmutableRequestSoundboardSounds.class) +@JsonDeserialize(as = ImmutableRequestSoundboardSounds.class) +public interface RequestSoundboardSounds extends PayloadData { + + static ImmutableRequestSoundboardSounds.Builder builder() { + return ImmutableRequestSoundboardSounds.builder(); + } + + @JsonProperty("guild_ids") + List guildIds(); + +} diff --git a/src/main/java/discord4j/discordjson/json/gateway/SoundboardSounds.java b/src/main/java/discord4j/discordjson/json/gateway/SoundboardSounds.java new file mode 100644 index 00000000..ba769913 --- /dev/null +++ b/src/main/java/discord4j/discordjson/json/gateway/SoundboardSounds.java @@ -0,0 +1,26 @@ +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 discord4j.discordjson.json.SoundboardSoundData; +import java.util.List; +import org.immutables.value.Value; + +@Value.Immutable +@JsonSerialize(as = ImmutableGuildSoundboardSoundCreate.class) +@JsonDeserialize(as = ImmutableGuildSoundboardSoundCreate.class) +public interface SoundboardSounds extends Dispatch { + + static ImmutableGuildSoundboardSoundCreate.Builder builder() { + return ImmutableGuildSoundboardSoundCreate.builder(); + } + + @JsonProperty("soundboard_sounds") + List soundboardSounds(); + + @JsonProperty("guild_id") + Id guildId(); + +} diff --git a/src/main/java/discord4j/discordjson/json/gateway/VoiceChannelEffectSend.java b/src/main/java/discord4j/discordjson/json/gateway/VoiceChannelEffectSend.java new file mode 100644 index 00000000..ccdebc92 --- /dev/null +++ b/src/main/java/discord4j/discordjson/json/gateway/VoiceChannelEffectSend.java @@ -0,0 +1,45 @@ +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 discord4j.discordjson.json.EmojiData; +import discord4j.discordjson.possible.Possible; +import java.util.Optional; +import javax.annotation.Nullable; +import org.immutables.value.Value; + +@Value.Immutable +@JsonSerialize(as = ImmutableVoiceChannelEffectSend.class) +@JsonDeserialize(as = ImmutableVoiceChannelEffectSend.class) +public interface VoiceChannelEffectSend extends Dispatch { + + static ImmutableVoiceChannelEffectSend.Builder builder() { + return ImmutableVoiceChannelEffectSend.builder(); + } + + @JsonProperty("channel_id") + Id channelId(); + + @JsonProperty("guild_id") + Id guildId(); + + @JsonProperty("user_id") + Id userId(); + + Possible> emoji(); + + @JsonProperty("animation_type") + Possible> animationType(); + + @JsonProperty("animation_id") + Possible animationId(); + + @JsonProperty("sound_id") + Possible soundId(); + + @JsonProperty("sound_volume") + Possible soundVolume(); + +} diff --git a/src/test/java/discord4j/discordjson/json/rest/RestDeserializationTest.java b/src/test/java/discord4j/discordjson/json/rest/RestDeserializationTest.java index 13b979ca..31ec065f 100644 --- a/src/test/java/discord4j/discordjson/json/rest/RestDeserializationTest.java +++ b/src/test/java/discord4j/discordjson/json/rest/RestDeserializationTest.java @@ -255,4 +255,10 @@ public void readGuildScheduledEvents() throws IOException { GuildScheduledEventData[] data = read("/rest/GuildScheduledEventData.json", GuildScheduledEventData[].class); log.info("{}", Arrays.asList(data)); } + + @Test + public void readSoundboardSoundData() throws IOException { + SoundboardSoundData[] data = read("/rest/SoundboardSoundData.json", SoundboardSoundData[].class); + log.info("{}", Arrays.asList(data)); + } } diff --git a/src/test/resources/rest/SoundboardSoundData.json b/src/test/resources/rest/SoundboardSoundData.json new file mode 100644 index 00000000..af5ed0fe --- /dev/null +++ b/src/test/resources/rest/SoundboardSoundData.json @@ -0,0 +1,19 @@ +[ + { + "name": "Yay", + "sound_id": "1106714396018884649", + "volume": 1, + "emoji_id": "989193655938064464", + "emoji_name": null, + "guild_id": "613425648685547541", + "available": true + }, + { + "name": "quack", + "sound_id": "1", + "volume": 1.0, + "emoji_id": null, + "emoji_name": "🦆", + "available": true + } +]