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

com.lukaspradel.steamapi.webapi.core.SteamWebApiInterface Maven / Gradle / Ivy

package com.lukaspradel.steamapi.webapi.core;

/**
 * Currently supported Steam Web API Interfaces as listed on Valve's Dev Wiki.
 *
 * @see https://developer.valvesoftware.com/wiki/Steam_Web_API
 *
 * @author lpradel
 *
 */
public enum SteamWebApiInterface {

	I_STEAM_NEWS("ISteamNews"), I_PLAYER_SERVICE("IPlayerService"), I_STEAM_USER(
			"ISteamUser"), I_STEAM_USER_STATS("ISteamUserStats");

	private final String apiInterface;

	private SteamWebApiInterface(String apiInterface) {
		this.apiInterface = apiInterface;
	}

	/**
	 * Returns the interface associated with the given Web Api Interface method.
	 *
	 * @param interfaceMethod
	 *            The Web API Interface method.
	 * @return The interface associated with the given Web Api Interface method.
	 */
	public static SteamWebApiInterface getInterfaceForMethod(
			SteamWebApiInterfaceMethod interfaceMethod) {

		if (interfaceMethod == null) {
			throw new IllegalArgumentException(
					"Unsupported Web API Interface method!");
		}

		switch (interfaceMethod) {

		case GET_FRIEND_LIST:
			return I_STEAM_USER;
		case GET_GLOBAL_ACHIEVEMENT_PERCENTAGES_FOR_APP:
			return I_STEAM_USER_STATS;
		case GET_NEWS_FOR_APP:
			return I_STEAM_NEWS;
		case GET_OWNED_GAMES:
			return I_PLAYER_SERVICE;
		case GET_PLAYER_ACHIEVEMENTS:
			return I_STEAM_USER_STATS;
		case GET_PLAYER_SUMMARIES:
			return I_STEAM_USER;
		case GET_RECENTLY_PLAYED_GAMES:
			return I_PLAYER_SERVICE;
		case GET_USER_STATS_FOR_GAME:
			return I_STEAM_USER_STATS;
		case IS_PLAYING_SHARED_GAME:
			return I_PLAYER_SERVICE;
		case GET_SCHEMA_FOR_GAME:
			return I_STEAM_USER_STATS;
		case GET_PLAYER_BANS:
			return I_STEAM_USER;
		default:
			throw new IllegalArgumentException(
					"Unsupported Web API Interface method!");
		}
	}

	@Override
	public String toString() {
		return apiInterface;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy