Skip to content

Commit

Permalink
fix: split PositionModifyRequest to ChannelPositionModifyRequest and …
Browse files Browse the repository at this point in the history
…RolePositionModifyRequest (#180)
  • Loading branch information
Azn9 authored Jun 21, 2024
1 parent 331eabe commit 805e2c3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
import java.util.Optional;

@Value.Immutable
@JsonSerialize(as = ImmutablePositionModifyRequest.class)
@JsonDeserialize(as = ImmutablePositionModifyRequest.class)
public interface PositionModifyRequest {
@JsonSerialize(as = ImmutableChannelPositionModifyRequest.class)
@JsonDeserialize(as = ImmutableChannelPositionModifyRequest.class)
public interface ChannelPositionModifyRequest {

static ImmutablePositionModifyRequest.Builder builder() {
return ImmutablePositionModifyRequest.builder();
static ImmutableChannelPositionModifyRequest.Builder builder() {
return ImmutableChannelPositionModifyRequest.builder();
}

String id();

int position();
Possible<Optional<Integer>> position();

@JsonProperty("lock_permissions")
Possible<Optional<Boolean>> lockPermissions();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package discord4j.discordjson.json;

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.Optional;

@Value.Immutable
@JsonSerialize(as = ImmutableRolePositionModifyRequest.class)
@JsonDeserialize(as = ImmutableRolePositionModifyRequest.class)
public interface RolePositionModifyRequest {

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

String id();

Possible<Optional<Integer>> position();

}

0 comments on commit 805e2c3

Please sign in to comment.