Skip to content

Commit

Permalink
Add avatar decoration fields (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
Doc94 authored Jun 21, 2024
1 parent 864749a commit 331eabe
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/main/java/discord4j/discordjson/json/AvatarDecorationData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
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 org.immutables.value.Value;

@Value.Immutable
@JsonSerialize(as = ImmutableAvatarDecorationData.class)
@JsonDeserialize(as = ImmutableAvatarDecorationData.class)
public interface AvatarDecorationData {

static ImmutableAvatarDecorationData.Builder builder() {
return ImmutableAvatarDecorationData.builder();
}

String asset();

@JsonProperty("sku_id")
Id skuId();

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ static ImmutablePartialMemberData.Builder builder() {
@JsonProperty("communication_disabled_until")
Possible<Optional<String>> communicationDisabledUntil();

@JsonProperty("avatar_decoration_data")
Possible<Optional<AvatarDecorationData>> avatarDecoration();

default long flags() {
return 0L;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ static ImmutableResolvedMemberData.Builder builder() {
@JsonProperty("communication_disabled_until")
Possible<Optional<String>> communicationDisabledUntil();

@JsonProperty("avatar_decoration_data")
Possible<Optional<AvatarDecorationData>> avatarDecoration();

default long flags() {
return 0L;
}
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/discord4j/discordjson/json/UserData.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,7 @@ static ImmutableUserData.Builder builder() {

@JsonProperty("public_flags")
Possible<Long> publicFlags();

@JsonProperty("avatar_decoration_data")
Possible<Optional<AvatarDecorationData>> avatarDecoration();
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import discord4j.discordjson.json.AvatarDecorationData;
import discord4j.discordjson.json.UserData;
import discord4j.discordjson.Id;
import discord4j.discordjson.possible.Possible;
Expand Down Expand Up @@ -42,4 +43,7 @@ static ImmutableGuildMemberUpdate.Builder builder() {
@JsonProperty("communication_disabled_until")
Possible<Optional<String>> communicationDisabledUntil();

@JsonProperty("avatar_decoration_data")
Possible<Optional<AvatarDecorationData>> avatarDecoration();

}

0 comments on commit 331eabe

Please sign in to comment.