-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added new models and fixed old models (#43)
* added models * add json ignore * fixed channel models * spotlessApply * fixed imports * used list * MOAR MODELS * added missing annotation * integrations
- Loading branch information
Showing
25 changed files
with
174 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...d/jdi/internal/models/channel/Thread.java → ...s/events/codec/models/channel/Thread.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...m/javadiscord/jdi/internal/gateway/handlers/events/codec/models/channel/ThreadMember.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.javadiscord.jdi.internal.gateway.handlers.events.codec.models.channel; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.util.List; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public record ThreadMember( | ||
@JsonProperty("id") long id, | ||
@JsonProperty("guild_id") long guildId, | ||
@JsonProperty("member_count") int memberCount, | ||
@JsonProperty("added_members") List<ThreadMember> addedMembers, | ||
@JsonProperty("removed_member_ids") List<Long> removedMemberIds) {} |
2 changes: 1 addition & 1 deletion
2
...al/models/channel/ThreadMemberUpdate.java → ...ec/models/channel/ThreadMemberUpdate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
...i/internal/models/channel/ThreadSync.java → ...ents/codec/models/channel/ThreadSync.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
package com.javadiscord.jdi.internal.models.channel; | ||
package com.javadiscord.jdi.internal.gateway.handlers.events.codec.models.channel; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.javadiscord.jdi.internal.models.channel.Channel; | ||
import com.javadiscord.jdi.internal.models.user.Member; | ||
|
||
import java.util.List; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public record ThreadSync( | ||
@JsonProperty("guild_id") String guildId, | ||
@JsonProperty("channel_ids") long[] channelIds, | ||
@JsonProperty("channel_ids") List<Long> channelIds, | ||
List<Channel> threads, | ||
List<Member> members) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/main/java/com/javadiscord/jdi/internal/models/channel/DefaultReaction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.javadiscord.jdi.internal.models.channel; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public record DefaultReaction( | ||
@JsonProperty("emoji_id") long emojiId, @JsonProperty("emoji_name") String emojiName) {} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/javadiscord/jdi/internal/models/channel/ForumTag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.javadiscord.jdi.internal.models.channel; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public record ForumTag( | ||
@JsonProperty("id") long id, | ||
@JsonProperty("name") String name, | ||
@JsonProperty("moderated") boolean moderated, | ||
@JsonProperty("emoji_id") long emojiId, | ||
@JsonProperty("emoji_name") String emojiName) {} |
16 changes: 10 additions & 6 deletions
16
src/main/java/com/javadiscord/jdi/internal/models/channel/ThreadMember.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,18 @@ | ||
package com.javadiscord.jdi.internal.models.channel; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.javadiscord.jdi.internal.models.guild.Member; | ||
|
||
import java.util.List; | ||
import java.time.OffsetDateTime; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public record ThreadMember( | ||
@JsonProperty("id") long id, | ||
@JsonProperty("guild_id") long guildId, | ||
@JsonProperty("member_count") int memberCount, | ||
@JsonProperty("added_members") List<ThreadMember> addedMembers, | ||
@JsonProperty("removed_member_ids") long[] removedMemberIds) {} | ||
@JsonProperty("id") long threadId, | ||
@JsonProperty("user_id") long userId, | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX") | ||
@JsonProperty("join_timestamp") | ||
OffsetDateTime joinTime, | ||
@JsonProperty("flags") int flags, | ||
@JsonProperty("member") Member member) {} |
30 changes: 30 additions & 0 deletions
30
src/main/java/com/javadiscord/jdi/internal/models/guild/Integration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.javadiscord.jdi.internal.models.guild; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.javadiscord.jdi.internal.models.user.User; | ||
|
||
import java.time.OffsetDateTime; | ||
|
||
// TODO: finish implementation | ||
// https://discord.com/developers/docs/resources/guild#integration-object | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public record Integration( | ||
@JsonProperty("id") long id, | ||
@JsonProperty("name") String name, | ||
@JsonProperty("type") String type, | ||
@JsonProperty("enabled") boolean enabled, | ||
@JsonProperty("syncing") boolean syncing, | ||
@JsonProperty("role_id") long roleId, | ||
@JsonProperty("enable_emoticons") boolean enableEmoticons, | ||
@JsonProperty("expire_behaviour") int expireBehaviour, | ||
@JsonProperty("expire_grace_period") int expireGracePeriod, | ||
@JsonProperty("user") User user, | ||
@JsonProperty("account") IntegrationAccount account, | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX") | ||
@JsonProperty("synced_at") | ||
OffsetDateTime syncedAt, | ||
@JsonProperty("subscriber_count") int subscriberCount, | ||
@JsonProperty("revoked") boolean revoked, | ||
@JsonProperty("application") IntegrationApplication application) {} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/javadiscord/jdi/internal/models/guild/IntegrationAccount.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.javadiscord.jdi.internal.models.guild; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public record IntegrationAccount( | ||
@JsonProperty("id") String id, @JsonProperty("name") String name) {} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/javadiscord/jdi/internal/models/guild/IntegrationApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.javadiscord.jdi.internal.models.guild; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.javadiscord.jdi.internal.models.user.User; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public record IntegrationApplication( | ||
@JsonProperty("id") long id, | ||
@JsonProperty("name") String name, | ||
@JsonProperty("icon") String icon, | ||
@JsonProperty("description") String description, | ||
@JsonProperty("bot") User bot) {} |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/javadiscord/jdi/internal/models/guild/IntegrationExpireBehaviour.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.javadiscord.jdi.internal.models.guild; | ||
|
||
public enum IntegrationExpireBehaviour { | ||
REMOVE_ROLE(0), | ||
KICK(1); | ||
|
||
private final int value; | ||
|
||
private IntegrationExpireBehaviour(int value) { | ||
this.value = value; | ||
} | ||
|
||
public int value() { | ||
return value; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/com/javadiscord/jdi/internal/models/guild/Member.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.javadiscord.jdi.internal.models.guild; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.javadiscord.jdi.internal.models.user.User; | ||
|
||
import java.time.OffsetDateTime; | ||
import java.util.List; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public record Member( | ||
@JsonProperty("user") User user, | ||
@JsonProperty("nick") String nick, | ||
@JsonProperty("avatar") String avatar, | ||
@JsonProperty("roles") List<Long> roles, | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX") | ||
@JsonProperty("joined_at") | ||
OffsetDateTime joinedAt, | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX") | ||
@JsonProperty("premium_since") | ||
OffsetDateTime premiumSince, | ||
@JsonProperty("deaf") boolean deaf, | ||
@JsonProperty("mute") boolean mute, | ||
@JsonProperty("flags") int flags, | ||
@JsonProperty("pending") boolean pending, | ||
@JsonProperty("permissions") String permissions, | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX") | ||
@JsonProperty("communication_disabled_until") | ||
OffsetDateTime communicationDisabledUntil) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters