From c8423a102782066add89e163b360c8ae07969ca5 Mon Sep 17 00:00:00 2001 From: rfresh2 <89827146+rfresh2@users.noreply.github.com> Date: Tue, 26 Mar 2024 20:07:31 -0700 Subject: [PATCH] Edit Current Application (#158) * Edit Current Application Adds support for https://discord.com/developers/docs/resources/application#edit-current-application * use Possible> for image data params --- .../json/ApplicationInfoRequest.java | 45 +++++++++++++++++++ .../discordjson/json/InstallParamsData.java | 21 +++++++++ 2 files changed, 66 insertions(+) create mode 100644 src/main/java/discord4j/discordjson/json/ApplicationInfoRequest.java create mode 100644 src/main/java/discord4j/discordjson/json/InstallParamsData.java diff --git a/src/main/java/discord4j/discordjson/json/ApplicationInfoRequest.java b/src/main/java/discord4j/discordjson/json/ApplicationInfoRequest.java new file mode 100644 index 00000000..ea98f4eb --- /dev/null +++ b/src/main/java/discord4j/discordjson/json/ApplicationInfoRequest.java @@ -0,0 +1,45 @@ +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.possible.Possible; +import org.immutables.value.Value; + +import java.util.List; +import java.util.Optional; + +@Value.Immutable +@JsonSerialize(as = ImmutableApplicationInfoRequest.class) +@JsonDeserialize(as = ImmutableApplicationInfoRequest.class) +public interface ApplicationInfoRequest { + + static ImmutableApplicationInfoRequest.Builder builder() { + return ImmutableApplicationInfoRequest.builder(); + } + + @JsonProperty("custom_install_url") + Possible customInstallUrl(); + + @JsonProperty("description") + Possible description(); + + @JsonProperty("role_connections_verification_url") + Possible roleConnectionsVerificationUrl(); + + @JsonProperty("install_params") + Possible installParams(); + + Possible flags(); + + Possible> icon(); + + @JsonProperty("cover_image") + Possible> coverImage(); + + @JsonProperty("interactions_endpoint_url") + Possible interactionsEndpointUrl(); + + Possible> tags(); + +} diff --git a/src/main/java/discord4j/discordjson/json/InstallParamsData.java b/src/main/java/discord4j/discordjson/json/InstallParamsData.java new file mode 100644 index 00000000..19d3db10 --- /dev/null +++ b/src/main/java/discord4j/discordjson/json/InstallParamsData.java @@ -0,0 +1,21 @@ +package discord4j.discordjson.json; + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.immutables.value.Value; + +import java.util.List; + +@Value.Immutable +@JsonSerialize(as = ImmutableInstallParamsData.class) +@JsonDeserialize(as = ImmutableInstallParamsData.class) +public interface InstallParamsData { + + static ImmutableInstallParamsData.Builder builder() { + return ImmutableInstallParamsData.builder(); + } + + List scopes(); + + String permissions(); +}