// Path: api/src/main/java/hirez/api/object/interfaces/Queue.java
// public interface Queue extends IDObject<Integer> {
//     String getName();
// 
//     boolean isRanked();
// }
// 
// Path: paladins/src/main/java/hirez/paladins/object/Rank.java
// @Data
// public class Rank implements ReturnedMessage {
//     @JsonProperty("Leaves")
//     private final int leaves;
//     @JsonProperty("Losses")
//     private final int losses;
//     @JsonProperty("Name")
//     private final String name;
//     @JsonProperty("Points")
//     private final int points;
//     @JsonProperty("PrevRank")
//     private final int prevRank;
//     @JsonProperty("Rank")
//     private final int rank;
//     @JsonProperty("Season")
//     private final int season;
//     @JsonProperty("Tier")
//     private final int tier;
//     @JsonProperty("Trend")
//     private final int trend;
//     @JsonProperty("Wins")
//     private final int wins;
//     private final long playerId;
//     @JsonProperty("ret_msg")
//     private final String returnedMessage;
// }


import hirez.api.*;
import hirez.api.object.*;
import hirez.api.object.interfaces.Queue;
import hirez.paladins.object.Rank;
import hirez.paladins.object.*;
import io.reactivex.rxjava3.core.Flowable;
import io.reactivex.rxjava3.core.Maybe;
import io.reactivex.rxjava3.core.Single;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.stream.Collectors;

    public Flowable<ChampionSkin> getChampionSkins(long championId, Language language) {
        return testAndCall(ChampionSkin[].class, "getchampionskins", Long.toString(championId), language.getId().toString())
                .flattenAsFlowable(Arrays::asList);
    }

    public Flowable<ChampionSkin> getChampionSkins(long championId) {
        return getChampionSkins(championId, getConfiguration().getLanguage());
    }

    public Flowable<Item> getItems(Language language) {
        return testAndCall(Item[].class, "getitems", language.getId().toString())
                .flattenAsFlowable(Arrays::asList);
    }

    public Flowable<Item> getItems() {
        return getItems(getConfiguration().getLanguage());
    }

    public Single<DemoDetail> getDemoDetails(long matchId) {
        return testAndCall(DemoDetail[].class, "getdemodetails", Long.toString(matchId))
                .flatMap(it -> Single.create(sink -> {
                    if (it.length > 0) {
                        sink.onSuccess(it[0]);
                    } else {
                        sink.onError(new HiRezException(String.format("Demo of match %d is not exist", matchId)));
                    }
                }));
    }

// Path: api/src/main/java/hirez/api/object/interfaces/Queue.java
// public interface Queue extends IDObject<Integer> {
//     String getName();
// 
//     boolean isRanked();
// }
// 
// Path: paladins/src/main/java/hirez/paladins/object/Rank.java
// @Data
// public class Rank implements ReturnedMessage {
//     @JsonProperty("Leaves")
//     private final int leaves;
//     @JsonProperty("Losses")
//     private final int losses;
//     @JsonProperty("Name")
//     private final String name;
//     @JsonProperty("Points")
//     private final int points;
//     @JsonProperty("PrevRank")
//     private final int prevRank;
//     @JsonProperty("Rank")
//     private final int rank;
//     @JsonProperty("Season")
//     private final int season;
//     @JsonProperty("Tier")
//     private final int tier;
//     @JsonProperty("Trend")
//     private final int trend;
//     @JsonProperty("Wins")
//     private final int wins;
//     private final long playerId;
//     @JsonProperty("ret_msg")
//     private final String returnedMessage;
// }


// Path: paladins/src/main/java/hirez/paladins/Paladins.java
import hirez.api.*;
import hirez.api.object.*;
import hirez.api.object.interfaces.Queue;
import hirez.paladins.object.Rank;
import hirez.paladins.object.*;
import io.reactivex.rxjava3.core.Flowable;
import io.reactivex.rxjava3.core.Maybe;
import io.reactivex.rxjava3.core.Single;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.stream.Collectors;


    public Flowable<ChampionSkin> getChampionSkins(long championId, Language language) {
        return testAndCall(ChampionSkin[].class, "getchampionskins", Long.toString(championId), language.getId().toString())
                .flattenAsFlowable(Arrays::asList);
    }

    public Flowable<ChampionSkin> getChampionSkins(long championId) {
        return getChampionSkins(championId, getConfiguration().getLanguage());
    }

    public Flowable<Item> getItems(Language language) {
        return testAndCall(Item[].class, "getitems", language.getId().toString())
                .flattenAsFlowable(Arrays::asList);
    }

    public Flowable<Item> getItems() {
        return getItems(getConfiguration().getLanguage());
    }

    public Single<DemoDetail> getDemoDetails(long matchId) {
        return testAndCall(DemoDetail[].class, "getdemodetails", Long.toString(matchId))
                .flatMap(it -> Single.create(sink -> {
                    if (it.length > 0) {
                        sink.onSuccess(it[0]);
                    } else {
                        sink.onError(new HiRezException(String.format("Demo of match %d is not exist", matchId)));
                    }
                }));
    }

    public Flowable<Rank> getLeagueLeaderboard(Queue queue, Division division, int round) {