All Downloads are FREE. Search and download functionalities are using the official Maven repository.

hirezapi.endpoints.MatchesEndpoint Maven / Gradle / Ivy

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));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy