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

com.ibasco.agql.protocols.valve.steam.webapi.interfaces.SteamCommunityService Maven / Gradle / Ivy

There is a newer version: 1.2.2
Show newest version
package com.ibasco.agql.protocols.valve.steam.webapi.interfaces;

import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import com.ibasco.agql.protocols.valve.steam.webapi.SteamWebApiClient;
import com.ibasco.agql.protocols.valve.steam.webapi.SteamWebApiInterface;
import com.ibasco.agql.protocols.valve.steam.webapi.interfaces.communityservice.GetApps;
import com.ibasco.agql.protocols.valve.steam.webapi.pojos.SteamCommunityApp;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.CompletableFuture;

public class SteamCommunityService extends SteamWebApiInterface {

    /**
     * 

Default Constructor

* * @param client * A {@link SteamWebApiClient} instance */ public SteamCommunityService(SteamWebApiClient client) { super(client); } public CompletableFuture> getApps(Integer... appIds) { return getApps(Arrays.asList(appIds)); } /** * Returns a list of apps retrieved from the community service interface. * * @param appIds * A collection of steam app ids * * @return A {@link CompletableFuture} object */ public CompletableFuture> getApps(Collection appIds) { CompletableFuture result = sendRequest(new GetApps(VERSION_1, appIds)); return result.thenApply(r -> { JsonObject response = r.getAsJsonObject("response"); Type listType = new TypeToken>() {}.getType(); return builder().fromJson(response.getAsJsonArray("apps"), listType); }); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy