Skip to content

Commit

Permalink
Merge 859ba13 into 7c8a9c1
Browse files Browse the repository at this point in the history
  • Loading branch information
Pazus committed Dec 13, 2016
2 parents 7c8a9c1 + 859ba13 commit ff0a56e
Show file tree
Hide file tree
Showing 42 changed files with 94,002 additions and 2 deletions.
111 changes: 111 additions & 0 deletions pom.xml
Expand Up @@ -254,6 +254,117 @@
<sourceDirectory>${basedir}/src/main/resources/com/lukaspradel/steamapi/schema/getplayerbans</sourceDirectory>
</configuration>
</execution>
<execution>
<id>generate-getheroes</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<targetPackage>com.lukaspradel.steamapi.data.json.dota2.getheroes</targetPackage>
<sourceDirectory>${basedir}/src/main/resources/com/lukaspradel/steamapi/schema/dota2/getheroes</sourceDirectory>
</configuration>
</execution>
<execution>
<id>generate-getmatchdetails</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<targetPackage>com.lukaspradel.steamapi.data.json.dota2.getmatchdetails</targetPackage>
<sourceDirectory>${basedir}/src/main/resources/com/lukaspradel/steamapi/schema/dota2/getmatchdetails</sourceDirectory>
</configuration>
</execution>
<execution>
<id>generate-getmatchhistory</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<targetPackage>com.lukaspradel.steamapi.data.json.dota2.getmatchhistory</targetPackage>
<sourceDirectory>${basedir}/src/main/resources/com/lukaspradel/steamapi/schema/dota2/getmatchhistory</sourceDirectory>
</configuration>
</execution>
<execution>
<id>generate-getleaguelisting</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<targetPackage>com.lukaspradel.steamapi.data.json.dota2.getleaguelisting</targetPackage>
<sourceDirectory>${basedir}/src/main/resources/com/lukaspradel/steamapi/schema/dota2/getleaguelisting</sourceDirectory>
</configuration>
</execution>
<execution>
<id>generate-getliveleaguegames</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<targetPackage>com.lukaspradel.steamapi.data.json.dota2.getliveleaguegames</targetPackage>
<sourceDirectory>${basedir}/src/main/resources/com/lukaspradel/steamapi/schema/dota2/getliveleaguegames</sourceDirectory>
</configuration>
</execution>
<execution>
<id>generate-getmatchhistorybysequencenum</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<targetPackage>com.lukaspradel.steamapi.data.json.dota2.getmatchhistorybysequencenum</targetPackage>
<sourceDirectory>${basedir}/src/main/resources/com/lukaspradel/steamapi/schema/dota2/getmatchhistorybysequencenum</sourceDirectory>
</configuration>
</execution>
<execution>
<id>generate-getteaminfobyteamid</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<targetPackage>com.lukaspradel.steamapi.data.json.dota2.getteaminfobyteamid</targetPackage>
<sourceDirectory>${basedir}/src/main/resources/com/lukaspradel/steamapi/schema/dota2/getteaminfobyteamid</sourceDirectory>
</configuration>
</execution>
<execution>
<id>generate-getgameitems</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<targetPackage>com.lukaspradel.steamapi.data.json.dota2.getgameitems</targetPackage>
<sourceDirectory>${basedir}/src/main/resources/com/lukaspradel/steamapi/schema/dota2/getgameitems</sourceDirectory>
</configuration>
</execution>
<execution>
<id>generate-getproplayerlist</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<targetPackage>com.lukaspradel.steamapi.data.json.dota2.getproplayerlist</targetPackage>
<sourceDirectory>${basedir}/src/main/resources/com/lukaspradel/steamapi/schema/dota2/getproplayerlist</sourceDirectory>
</configuration>
</execution>
<execution>
<id>generate-getplayerofficialinfo</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<targetPackage>com.lukaspradel.steamapi.data.json.dota2.getplayerofficialinfo</targetPackage>
<sourceDirectory>${basedir}/src/main/resources/com/lukaspradel/steamapi/schema/dota2/getplayerofficialinfo</sourceDirectory>
</configuration>
</execution>
<execution>
<id>generate-getfantasyplayerstats</id>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<targetPackage>com.lukaspradel.steamapi.data.json.dota2.getfantasyplayerstats</targetPackage>
<sourceDirectory>${basedir}/src/main/resources/com/lukaspradel/steamapi/schema/dota2/getfantasyplayerstats</sourceDirectory>
</configuration>
</execution>

</executions>
</plugin>
</plugins>
Expand Down
Expand Up @@ -12,7 +12,9 @@
public enum SteamWebApiInterface {

I_STEAM_NEWS("ISteamNews"), I_PLAYER_SERVICE("IPlayerService"), I_STEAM_USER(
"ISteamUser"), I_STEAM_USER_STATS("ISteamUserStats");
"ISteamUser"), I_STEAM_USER_STATS("ISteamUserStats"), I_ECON_DOTA2(
"IEconDOTA2_570"), I_DOTA2_MATCH("IDOTA2Match_570"), I_DOTA2_FANTASY(
"IDOTA2Fantasy_570");

private final String apiInterface;

Expand Down Expand Up @@ -61,6 +63,28 @@ public static SteamWebApiInterface getInterfaceForMethod(
return I_STEAM_USER_STATS;
case GET_PLAYER_BANS:
return I_STEAM_USER;
case GET_HEROES:
return I_ECON_DOTA2;
case GET_MATCH_HISTORY:
return I_DOTA2_MATCH;
case GET_MATCH_DETAILS:
return I_DOTA2_MATCH;
case GET_LEAGUE_LISTING:
return I_DOTA2_MATCH;
case GET_LIVE_LEAGUE_GAMES:
return I_DOTA2_MATCH;
case GET_MATCH_HISTORY_BY_SEQUENCE_NUM:
return I_DOTA2_MATCH;
case GET_TEAM_INFO_BY_TEAM_ID:
return I_DOTA2_MATCH;
case GET_GAME_ITEMS:
return I_ECON_DOTA2;
case GET_PRO_PLAYER_LIST:
return I_DOTA2_FANTASY;
case GET_PLAYER_OFFICIAL_INFO:
return I_DOTA2_FANTASY;
case GET_FANTASY_PLAYER_STATS:
return I_DOTA2_FANTASY;
default:
throw new IllegalArgumentException(
"Unsupported Web API Interface method!");
Expand Down
Expand Up @@ -2,6 +2,8 @@

import com.lukaspradel.steamapi.data.json.achievementpercentages.GetGlobalAchievementPercentagesForApp;
import com.lukaspradel.steamapi.data.json.appnews.GetNewsForApp;
import com.lukaspradel.steamapi.data.json.dota2.fantasyplayerstats.GetFantasyPlayerStats;
import com.lukaspradel.steamapi.data.json.dota2.playerofficialinfo.GetPlayerOfficialInfo;
import com.lukaspradel.steamapi.data.json.friendslist.GetFriendList;
import com.lukaspradel.steamapi.data.json.getglobalstatsforgame.GetGlobalStatsForGame;
import com.lukaspradel.steamapi.data.json.getplayerbans.GetPlayerBans;
Expand All @@ -12,6 +14,15 @@
import com.lukaspradel.steamapi.data.json.playerstats.GetUserStatsForGame;
import com.lukaspradel.steamapi.data.json.playersummaries.GetPlayerSummaries;
import com.lukaspradel.steamapi.data.json.recentlyplayedgames.GetRecentlyPlayedGames;
import com.lukaspradel.steamapi.data.json.dota2.heroes.GetHeroes;
import com.lukaspradel.steamapi.data.json.dota2.matchdetails.GetMatchDetails;
import com.lukaspradel.steamapi.data.json.dota2.matchhistory.GetMatchHistory;
import com.lukaspradel.steamapi.data.json.dota2.leaguelisting.GetLeagueListing;
import com.lukaspradel.steamapi.data.json.dota2.liveleaguegames.GetLiveLeagueGames;
import com.lukaspradel.steamapi.data.json.dota2.matchhistorybysequencenum.GetMatchHistoryBySequenceNum;
import com.lukaspradel.steamapi.data.json.dota2.teaminfobyteamid.GetTeamInfoByTeamID;
import com.lukaspradel.steamapi.data.json.dota2.gameitems.GetGameItems;
import com.lukaspradel.steamapi.data.json.dota2.proplayerlist.GetProPlayerList;

/**
* Currently supported Steam Web API Interface Methods as listed on Valve's Dev
Expand All @@ -37,7 +48,19 @@ public enum SteamWebApiInterfaceMethod {
"GetRecentlyPlayedGames", GetRecentlyPlayedGames.class), IS_PLAYING_SHARED_GAME(
"IsPlayingSharedGame", IsPlayingSharedGame.class), GET_SCHEMA_FOR_GAME(
"GetSchemaForGame", GetSchemaForGame.class), GET_PLAYER_BANS(
"GetPlayerBans", GetPlayerBans.class);
"GetPlayerBans", GetPlayerBans.class), GET_HEROES(
"GetHeroes",GetHeroes.class), GET_MATCH_DETAILS(
"GetMatchDetails",GetMatchDetails.class), GET_MATCH_HISTORY(
"GetMatchHistory",GetMatchHistory.class), GET_LEAGUE_LISTING(
"GetLeagueListing",GetLeagueListing.class), GET_LIVE_LEAGUE_GAMES(
"GetLiveLeagueGames",GetLiveLeagueGames.class), GET_MATCH_HISTORY_BY_SEQUENCE_NUM(
"GetMatchHistoryBySequenceNum",GetMatchHistoryBySequenceNum.class), GET_TEAM_INFO_BY_TEAM_ID(
"GetTeamInfoByTeamID",GetTeamInfoByTeamID.class), GET_GAME_ITEMS(
"GetGameItems",GetGameItems.class), GET_PRO_PLAYER_LIST(
"GetProPlayerList",GetProPlayerList.class), GET_PLAYER_OFFICIAL_INFO(
"GetPlayerOfficialInfo",GetPlayerOfficialInfo.class), GET_FANTASY_PLAYER_STATS(
"GetFantasyPlayerStats",GetFantasyPlayerStats.class)
;

private final String interfaceMethod;

Expand Down
Expand Up @@ -58,6 +58,28 @@ public static SteamWebApiVersion getCurrentVersionForWebApiInterfaceMethod(
return VERSION_TWO;
case GET_PLAYER_BANS:
return VERSION_ONE;
case GET_HEROES:
return VERSION_ONE;
case GET_MATCH_DETAILS:
return VERSION_ONE;
case GET_MATCH_HISTORY:
return VERSION_ONE;
case GET_LEAGUE_LISTING:
return VERSION_ONE;
case GET_LIVE_LEAGUE_GAMES:
return VERSION_ONE;
case GET_MATCH_HISTORY_BY_SEQUENCE_NUM:
return VERSION_ONE;
case GET_TEAM_INFO_BY_TEAM_ID:
return VERSION_ONE;
case GET_GAME_ITEMS:
return VERSION_ONE;
case GET_PRO_PLAYER_LIST:
return VERSION_ONE;
case GET_PLAYER_OFFICIAL_INFO:
return VERSION_ONE;
case GET_FANTASY_PLAYER_STATS:
return VERSION_ONE;
default:
throw new IllegalArgumentException(
"Unsupported Web API Interface method!");
Expand Down
Expand Up @@ -41,6 +41,11 @@ protected void addParameter(String name, Integer value) {
parameters.put(name, String.valueOf(value));
}

protected void addParameter(String name, Long value) {

parameters.put(name, value.toString());
}

/**
* Adds List-parameter as comma-separated strings
*
Expand Down
Expand Up @@ -28,6 +28,18 @@
import com.lukaspradel.steamapi.webapi.request.IsPlayingSharedGameRequest;
import com.lukaspradel.steamapi.webapi.request.IsPlayingSharedGameRequest.IsPlayingSharedGameRequestBuilder;
import com.lukaspradel.steamapi.webapi.request.SteamWebApiRequest;
import com.lukaspradel.steamapi.webapi.request.dota2.*;
import com.lukaspradel.steamapi.webapi.request.dota2.GetGameItemsRequest.GetGameItemsRequestBuilder;
import com.lukaspradel.steamapi.webapi.request.dota2.GetHeroesRequest.GetHeroesRequestBuilder;
import com.lukaspradel.steamapi.webapi.request.dota2.GetLeagueListingRequest.GetLeagueListingRequestBuilder;
import com.lukaspradel.steamapi.webapi.request.dota2.GetLiveLeagueGamesRequest.GetLiveLeagueGamesRequestBuilder;
import com.lukaspradel.steamapi.webapi.request.dota2.GetMatchDetailsRequest.GetMatchDetailsRequestBuilder;
import com.lukaspradel.steamapi.webapi.request.dota2.GetMatchHistoryBySequenceNumRequest.GetMatchHistoryBySequenceNumRequestBuilder;
import com.lukaspradel.steamapi.webapi.request.dota2.GetMatchHistoryRequest.GetMatchHistoryRequestBuilder;
import com.lukaspradel.steamapi.webapi.request.dota2.GetTeamInfoByTeamIDRequest.GetTeamInfoByTeamIDRequestBuilder;
import com.lukaspradel.steamapi.webapi.request.dota2.GetFantasyPlayerStatsRequest.GetFantasyPlayerStatsRequestBuilder;
import com.lukaspradel.steamapi.webapi.request.dota2.GetPlayerOfficialInfoRequest.GetPlayerOfficialInfoRequestBuilder;
import com.lukaspradel.steamapi.webapi.request.dota2.GetProPlayerListRequest.GetProPlayerListRequestBuilder;

/**
* Convenience class to create instances of {@link SteamWebApiRequest}.
Expand Down Expand Up @@ -156,4 +168,54 @@ public static GetPlayerBansRequest createGetPlayerBansRequest(

return new GetPlayerBansRequestBuilder(steamIds).buildRequest();
}

public static GetGameItemsRequest createGetGameItemsRequest() {
return new GetGameItemsRequestBuilder().buildRequest();
}

public static GetHeroesRequest createGetHeroesRequest() {
return new GetHeroesRequestBuilder().language("en").buildRequest();
}

public static GetLeagueListingRequest createGetLeagueListingRequest() {
return new GetLeagueListingRequestBuilder().buildRequest();
}

public static GetLiveLeagueGamesRequest createGetLiveLeagueGamesRequest() {
return new GetLiveLeagueGamesRequestBuilder().buildRequest();
}

public static GetMatchDetailsRequest createGetMatchDetailsRequest(String matchId) {
return new GetMatchDetailsRequestBuilder(matchId).buildRequest();
}

public static GetMatchHistoryBySequenceNumRequest createGetMatchHistoryBySequenceNumRequest() {
return new GetMatchHistoryBySequenceNumRequestBuilder().buildRequest();
}

public static GetMatchHistoryRequest createGetMatchHistoryRequest(String accountId, GetMatchHistoryRequest.GameMode gameMode) {
return new GetMatchHistoryRequestBuilder()
.gameMode(gameMode)
.accountId(accountId)
.buildRequest();
}

public static GetTeamInfoByTeamIDRequest createGetTeamInfoByTeamIDRequest(Long teamId) {
return new GetTeamInfoByTeamIDRequestBuilder()
.startAtTeamId(teamId)
.teamsRequested(1)
.buildRequest();
}

public static GetFantasyPlayerStatsRequest createGetFantasyPlayerStatsRequest(String fantasyLeagueId) {
return new GetFantasyPlayerStatsRequestBuilder(fantasyLeagueId).buildRequest();
}

public static GetPlayerOfficialInfoRequest createGetPlayerOfficialInfoRequest(String accountId) {
return new GetPlayerOfficialInfoRequestBuilder(accountId).buildRequest();
}

public static GetProPlayerListRequest createGetProPlayerListRequest() {
return new GetProPlayerListRequestBuilder().buildRequest();
}
}

0 comments on commit ff0a56e

Please sign in to comment.