public virtual IEnumerable <PubgPlayer> GetPlayers(PubgPlatform platform, GetPubgPlayersRequest filter) { var url = RequestBuilder.BuildRequestUrl(Api.Players.PlayersEndpoint(platform), filter); var apiKey = string.IsNullOrEmpty(filter.ApiKey) ? ApiKey : filter.ApiKey; var collectionJson = HttpRequestor.GetString(url, apiKey); return(JsonConvert.DeserializeObject <IEnumerable <PubgPlayer> >(collectionJson, new JsonApiSerializerSettings())); }
public virtual async Task <IEnumerable <PubgPlayer> > GetPlayersAsync(PubgPlatform platform, GetPubgPlayersRequest filter, CancellationToken cancellationToken = default(CancellationToken)) { var url = RequestBuilder.BuildRequestUrl(Api.Players.PlayersEndpoint(platform), filter); var apiKey = string.IsNullOrEmpty(filter.ApiKey) ? ApiKey : filter.ApiKey; var collectionJson = await HttpRequestor.GetStringAsync(url, cancellationToken, apiKey).ConfigureAwait(false); return(JsonConvert.DeserializeObject <IEnumerable <PubgPlayer> >(collectionJson, new JsonApiSerializerSettings())); }