hirezapi.endpoints.MatchesEndpoint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of HiRezApi-common Show documentation
Show all versions of HiRezApi-common Show documentation
Java-Based API Wrapper for Hi-Rez Studios games.
The newest version!
package hirezapi.endpoints;
import hirezapi.HiRezApi;
import hirezapi.enums.Queue;
import hirezapi.json.DemoDetails;
import hirezapi.json.LeagueSeason;
import hirezapi.json.ProLeagueMatch;
import java.util.Arrays;
import java.util.List;
public class MatchesEndpoint extends AbstractEndpoint {
public MatchesEndpoint(HiRezApi api) {
super(api);
}
public DemoDetails getDemoDetails(long matchId) {
return api.getRestController()
.request(buildUrl("getdemodetails", Long.toString(matchId)), DemoDetails[].class)[0];
}
public List getEsportsProLeagueDetails() {
return Arrays.asList(api.getRestController()
.request(buildUrl("getesportsproleaguedetails"), ProLeagueMatch[].class));
}
/**
* Getting League Seasons.
* @param queue Ranked Queue
* @return Currently season with split's
*/
public List getLeagueSeasons(Queue queue) {
return Arrays.asList(api.getRestController()
.request(buildUrl("getleagueseasons",
Integer.toString(queue.getId())), LeagueSeason[].class));
}
}