public async Task <UserAndFriendsApps> GetUserAndFriendsAppsAsync(FriendPlayRequestParameters requestParameters) { using (HttpResponseMessage response = await RequestAsync(requestParameters)) { if (response.IsSuccessStatusCode) { var json = await response.Content.ReadAsStringAsync(); var resp = UserAndFriendsApps.FromJson(json); return(resp?.Success == true ? resp : null); } } return(null); }
private string FormatProperties(FriendPlayRequestParameters rp) => URL_Properties(rp);
private Task <HttpResponseMessage> RequestAsync(FriendPlayRequestParameters rp) => client.GetAsync(FormatProperties(rp));
//URL_PROPERTIES = //@"?userId={long}&ownershipThreshold={int}&onlyUserOwned={bool}&includePlayedFreeGames={bool}"; private static string URL_Properties(FriendPlayRequestParameters rp) => $"?userId={rp.SteamUserId}&ownershipThreshold={rp.OwnershipThreshold}&onlyUserOwned={rp.OnlyUserOwned}&includePlayedFreeGames={rp.IncludePlayedFreeGames}";