Skip to content

Commit

Permalink
Edit Current Application (#158)
Browse files Browse the repository at this point in the history
* Edit Current Application

Adds support for https://discord.com/developers/docs/resources/application#edit-current-application

* use Possible<Optional<String>> for image data params
  • Loading branch information
rfresh2 authored Mar 27, 2024
1 parent 1df1663 commit c8423a1
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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<String> customInstallUrl();

@JsonProperty("description")
Possible<String> description();

@JsonProperty("role_connections_verification_url")
Possible<String> roleConnectionsVerificationUrl();

@JsonProperty("install_params")
Possible<InstallParamsData> installParams();

Possible<Integer> flags();

Possible<Optional<String>> icon();

@JsonProperty("cover_image")
Possible<Optional<String>> coverImage();

@JsonProperty("interactions_endpoint_url")
Possible<String> interactionsEndpointUrl();

Possible<List<String>> tags();

}
21 changes: 21 additions & 0 deletions src/main/java/discord4j/discordjson/json/InstallParamsData.java
Original file line number Diff line number Diff line change
@@ -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<String> scopes();

String permissions();
}

0 comments on commit c8423a1

Please sign in to comment.