From cbb2569313061cbaa001f27b020c15ac19103a99 Mon Sep 17 00:00:00 2001 From: Vasily Vasilyev Date: Tue, 14 May 2019 21:53:39 +0300 Subject: [PATCH] Remove unused using statements --- .../Classes/appdetails/Achievements.cs | 8 +-- .../Classes/appdetails/Category.cs | 9 +--- .../Classes/appdetails/Highlighted.cs | 9 +--- .../Classes/appdetails/Movie.cs | 8 +-- .../Classes/appdetails/PackageGroup.cs | 8 +-- .../Classes/appdetails/Recommendations.cs | 9 +--- .../Classes/appdetails/Requirements.cs | 9 +--- .../Classes/appdetails/Screenshot.cs | 9 +--- .../Classes/appdetails/SteamApp.cs | 4 -- SteamStorefrontAPI/Classes/appdetails/Sub.cs | 9 +--- .../Classes/appdetails/SupportInfo.cs | 9 +--- SteamStorefrontAPI/Classes/common/AppInfo.cs | 6 --- .../Classes/common/Converters.cs | 8 +-- SteamStorefrontAPI/Classes/common/Genre.cs | 9 +--- .../Classes/common/Platforms.cs | 9 +--- .../Classes/common/PriceOverview.cs | 6 --- .../Classes/common/ReleaseDate.cs | 9 +--- .../Classes/featured/FeaturedApps.cs | 9 +--- .../featuredcategories/FeaturedCategory.cs | 3 -- .../packagedetails/FullGamepadSupport.cs | 9 +--- .../Classes/packagedetails/PackageApp.cs | 6 --- .../Classes/packagedetails/PackageInfo.cs | 6 +-- SteamStorefrontAPI/Endpoints/AppDetails.cs | 44 +++++++++++------ SteamStorefrontAPI/Endpoints/Featured.cs | 39 +++++++++------ .../Endpoints/FeaturedCategories.cs | 40 +++++++++------ .../Endpoints/PackageDetails.cs | 49 ++++++++++++------- SteamStorefrontConsole/Program.cs | 8 ++- 27 files changed, 129 insertions(+), 222 deletions(-) diff --git a/SteamStorefrontAPI/Classes/appdetails/Achievements.cs b/SteamStorefrontAPI/Classes/appdetails/Achievements.cs index 8ef890d..542e767 100644 --- a/SteamStorefrontAPI/Classes/appdetails/Achievements.cs +++ b/SteamStorefrontAPI/Classes/appdetails/Achievements.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Globalization; +using System.Collections.Generic; using Newtonsoft.Json; -using Newtonsoft.Json.Converters; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/appdetails/Category.cs b/SteamStorefrontAPI/Classes/appdetails/Category.cs index ccc585e..6d505ea 100644 --- a/SteamStorefrontAPI/Classes/appdetails/Category.cs +++ b/SteamStorefrontAPI/Classes/appdetails/Category.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Globalization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; +using Newtonsoft.Json; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/appdetails/Highlighted.cs b/SteamStorefrontAPI/Classes/appdetails/Highlighted.cs index cd92039..e148e3b 100644 --- a/SteamStorefrontAPI/Classes/appdetails/Highlighted.cs +++ b/SteamStorefrontAPI/Classes/appdetails/Highlighted.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Globalization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; +using Newtonsoft.Json; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/appdetails/Movie.cs b/SteamStorefrontAPI/Classes/appdetails/Movie.cs index eb7ebb0..367f602 100644 --- a/SteamStorefrontAPI/Classes/appdetails/Movie.cs +++ b/SteamStorefrontAPI/Classes/appdetails/Movie.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Globalization; +using System.Collections.Generic; using Newtonsoft.Json; -using Newtonsoft.Json.Converters; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/appdetails/PackageGroup.cs b/SteamStorefrontAPI/Classes/appdetails/PackageGroup.cs index 7cc9967..5b3c80f 100644 --- a/SteamStorefrontAPI/Classes/appdetails/PackageGroup.cs +++ b/SteamStorefrontAPI/Classes/appdetails/PackageGroup.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Globalization; +using System.Collections.Generic; using Newtonsoft.Json; -using Newtonsoft.Json.Converters; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/appdetails/Recommendations.cs b/SteamStorefrontAPI/Classes/appdetails/Recommendations.cs index 691c369..60ff310 100644 --- a/SteamStorefrontAPI/Classes/appdetails/Recommendations.cs +++ b/SteamStorefrontAPI/Classes/appdetails/Recommendations.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Globalization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; +using Newtonsoft.Json; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/appdetails/Requirements.cs b/SteamStorefrontAPI/Classes/appdetails/Requirements.cs index 3141eee..aac0c3c 100644 --- a/SteamStorefrontAPI/Classes/appdetails/Requirements.cs +++ b/SteamStorefrontAPI/Classes/appdetails/Requirements.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Globalization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; +using Newtonsoft.Json; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/appdetails/Screenshot.cs b/SteamStorefrontAPI/Classes/appdetails/Screenshot.cs index 66e24e0..2d93c82 100644 --- a/SteamStorefrontAPI/Classes/appdetails/Screenshot.cs +++ b/SteamStorefrontAPI/Classes/appdetails/Screenshot.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Globalization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; +using Newtonsoft.Json; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/appdetails/SteamApp.cs b/SteamStorefrontAPI/Classes/appdetails/SteamApp.cs index 74aad5f..f480efe 100644 --- a/SteamStorefrontAPI/Classes/appdetails/SteamApp.cs +++ b/SteamStorefrontAPI/Classes/appdetails/SteamApp.cs @@ -1,12 +1,8 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Globalization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Linq; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/appdetails/Sub.cs b/SteamStorefrontAPI/Classes/appdetails/Sub.cs index 80d354d..203066e 100644 --- a/SteamStorefrontAPI/Classes/appdetails/Sub.cs +++ b/SteamStorefrontAPI/Classes/appdetails/Sub.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Globalization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; +using Newtonsoft.Json; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/appdetails/SupportInfo.cs b/SteamStorefrontAPI/Classes/appdetails/SupportInfo.cs index b97d8b6..12cb15f 100644 --- a/SteamStorefrontAPI/Classes/appdetails/SupportInfo.cs +++ b/SteamStorefrontAPI/Classes/appdetails/SupportInfo.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Globalization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; +using Newtonsoft.Json; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/common/AppInfo.cs b/SteamStorefrontAPI/Classes/common/AppInfo.cs index 97a5688..c4c626b 100644 --- a/SteamStorefrontAPI/Classes/common/AppInfo.cs +++ b/SteamStorefrontAPI/Classes/common/AppInfo.cs @@ -1,11 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Globalization; using Newtonsoft.Json; -using Newtonsoft.Json.Converters; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/common/Converters.cs b/SteamStorefrontAPI/Classes/common/Converters.cs index b2fb2e4..6ddf607 100644 --- a/SteamStorefrontAPI/Classes/common/Converters.cs +++ b/SteamStorefrontAPI/Classes/common/Converters.cs @@ -1,9 +1,5 @@ -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; +using Newtonsoft.Json; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/common/Genre.cs b/SteamStorefrontAPI/Classes/common/Genre.cs index 60f3e88..ece2763 100644 --- a/SteamStorefrontAPI/Classes/common/Genre.cs +++ b/SteamStorefrontAPI/Classes/common/Genre.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Globalization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; +using Newtonsoft.Json; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/common/Platforms.cs b/SteamStorefrontAPI/Classes/common/Platforms.cs index 8f88c1b..9179b1d 100644 --- a/SteamStorefrontAPI/Classes/common/Platforms.cs +++ b/SteamStorefrontAPI/Classes/common/Platforms.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Globalization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; +using Newtonsoft.Json; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/common/PriceOverview.cs b/SteamStorefrontAPI/Classes/common/PriceOverview.cs index d94be04..524cf40 100644 --- a/SteamStorefrontAPI/Classes/common/PriceOverview.cs +++ b/SteamStorefrontAPI/Classes/common/PriceOverview.cs @@ -1,11 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Globalization; using Newtonsoft.Json; -using Newtonsoft.Json.Converters; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/common/ReleaseDate.cs b/SteamStorefrontAPI/Classes/common/ReleaseDate.cs index be0e24a..4e04894 100644 --- a/SteamStorefrontAPI/Classes/common/ReleaseDate.cs +++ b/SteamStorefrontAPI/Classes/common/ReleaseDate.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Globalization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; +using Newtonsoft.Json; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/featured/FeaturedApps.cs b/SteamStorefrontAPI/Classes/featured/FeaturedApps.cs index a537829..43c162f 100644 --- a/SteamStorefrontAPI/Classes/featured/FeaturedApps.cs +++ b/SteamStorefrontAPI/Classes/featured/FeaturedApps.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; using System.Globalization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; @@ -26,9 +22,6 @@ namespace SteamStorefrontAPI.Classes [JsonProperty("layout")] public string Layout { get; set; } - //[JsonProperty("status")] - //public int Status { get; set; } - public FeaturedApps() { this.LargeCapsules = new List(); diff --git a/SteamStorefrontAPI/Classes/featuredcategories/FeaturedCategory.cs b/SteamStorefrontAPI/Classes/featuredcategories/FeaturedCategory.cs index 361cac6..de68b0c 100644 --- a/SteamStorefrontAPI/Classes/featuredcategories/FeaturedCategory.cs +++ b/SteamStorefrontAPI/Classes/featuredcategories/FeaturedCategory.cs @@ -1,8 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Globalization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; diff --git a/SteamStorefrontAPI/Classes/packagedetails/FullGamepadSupport.cs b/SteamStorefrontAPI/Classes/packagedetails/FullGamepadSupport.cs index 2b36b2d..32a9888 100644 --- a/SteamStorefrontAPI/Classes/packagedetails/FullGamepadSupport.cs +++ b/SteamStorefrontAPI/Classes/packagedetails/FullGamepadSupport.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Globalization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; +using Newtonsoft.Json; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/packagedetails/PackageApp.cs b/SteamStorefrontAPI/Classes/packagedetails/PackageApp.cs index 6e6aa3e..e74cfa7 100644 --- a/SteamStorefrontAPI/Classes/packagedetails/PackageApp.cs +++ b/SteamStorefrontAPI/Classes/packagedetails/PackageApp.cs @@ -1,11 +1,5 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Globalization; using Newtonsoft.Json; -using Newtonsoft.Json.Converters; namespace SteamStorefrontAPI.Classes { diff --git a/SteamStorefrontAPI/Classes/packagedetails/PackageInfo.cs b/SteamStorefrontAPI/Classes/packagedetails/PackageInfo.cs index 064a72d..90896af 100644 --- a/SteamStorefrontAPI/Classes/packagedetails/PackageInfo.cs +++ b/SteamStorefrontAPI/Classes/packagedetails/PackageInfo.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; using System.Globalization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; diff --git a/SteamStorefrontAPI/Endpoints/AppDetails.cs b/SteamStorefrontAPI/Endpoints/AppDetails.cs index 2f361d5..b9f6420 100644 --- a/SteamStorefrontAPI/Endpoints/AppDetails.cs +++ b/SteamStorefrontAPI/Endpoints/AppDetails.cs @@ -1,23 +1,21 @@ -using Newtonsoft.Json.Linq; -using SteamStorefrontAPI.Classes; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; -using System.Text; +using System.Net.Http; using System.Threading.Tasks; +using Newtonsoft.Json.Linq; +using SteamStorefrontAPI.Classes; namespace SteamStorefrontAPI { /// - /// Endpoint returning details for an application in the steam store. + /// Endpoint returning details for an application in the steam store. + /// public static class AppDetails { private static HttpClient client = new HttpClient(); private const string steamBaseUri = "http://store.steampowered.com/api/appdetails"; /// - /// Retrieves details for the specified application via an asynchronous operation. + /// Retrieves details for the specified application via an asynchronous operation. + /// /// Steam App ID. public static async Task GetAsync(int AppId) { @@ -25,24 +23,38 @@ namespace SteamStorefrontAPI } /// - /// Retrieves details for the specified application via an asynchronous operation. + /// Retrieves details for the specified application via an asynchronous operation. + /// /// Steam App ID. - /// Two letter country code to customise currency and date values. + /// + /// Two letter country code to customise currency and date values. + /// public static async Task GetAsync(int AppId, string CountryCode) { return await GetAsync(AppId, CountryCode, ""); } /// - /// Retrieves details for the specified application via an asynchronous operation. + /// Retrieves details for the specified application via an asynchronous operation. + /// /// Steam App ID. - /// Two letter country code to customise currency and date values. - /// Full name of the language in english used for string localization e.g. title, description, release dates. + /// + /// Two letter country code to customise currency and date values. + /// + /// + /// Full name of the language in english used for string localization e.g. title, + /// description, release dates. + /// public static async Task GetAsync(int AppId, string CountryCode, string Language) { string steamUri = $"{steamBaseUri}?appids={AppId}"; - steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}&cc={CountryCode}"; - steamUri = string.IsNullOrWhiteSpace(Language) ? steamUri : $"{steamUri}&l={Language.ToLower()}"; + steamUri = string.IsNullOrWhiteSpace(CountryCode) + ? steamUri + : $"{steamUri}&cc={CountryCode}"; + + steamUri = string.IsNullOrWhiteSpace(Language) + ? steamUri + : $"{steamUri}&l={Language.ToLower()}"; var response = await client.GetAsync(steamUri); if (!response.IsSuccessStatusCode) { return null; } diff --git a/SteamStorefrontAPI/Endpoints/Featured.cs b/SteamStorefrontAPI/Endpoints/Featured.cs index 2c0b0ab..2fece15 100644 --- a/SteamStorefrontAPI/Endpoints/Featured.cs +++ b/SteamStorefrontAPI/Endpoints/Featured.cs @@ -1,44 +1,53 @@ -using Newtonsoft.Json.Linq; -using SteamStorefrontAPI.Classes; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; -using System.Text; +using System.Net.Http; using System.Threading.Tasks; +using Newtonsoft.Json.Linq; +using SteamStorefrontAPI.Classes; namespace SteamStorefrontAPI { /// - /// Endpoint returning a list of featured items in the steam store. + /// Endpoint returning a list of featured items in the steam store. + /// public static class Featured { private static HttpClient client = new HttpClient(); private const string steamBaseUri = "https://store.steampowered.com/api/featured"; /// - /// Retrieves a list of featured items via an asynchronous operation. + /// Retrieves a list of featured items via an asynchronous operation. + /// public static async Task GetAsync() { return await GetAsync(null, null); } /// - /// Retrieves a list of featured items via an asynchronous operation. - /// Two letter country code to customise currency and date values. + /// Retrieves a list of featured items via an asynchronous operation. + /// + /// + /// Two letter country code to customise currency and date values. + /// public static async Task GetAsync(string CountryCode) { return await GetAsync(CountryCode, null); } /// - /// Retrieves a list of featured items via an asynchronous operation. - /// Two letter country code to customise currency and date values. - /// Full name of the language in english used for string localization e.g. name, description. + /// Retrieves a list of featured items via an asynchronous operation. + /// + /// + /// Two letter country code to customise currency and date values. + /// + /// + /// Full name of the language in english used for string localization e.g. name, + /// description. + /// public static async Task GetAsync(string CountryCode, string Language) { string steamUri = steamBaseUri; - steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}?cc={CountryCode}"; + steamUri = string.IsNullOrWhiteSpace(CountryCode) + ? steamUri + : $"{steamUri}?cc={CountryCode}"; if (!string.IsNullOrWhiteSpace(Language)) { diff --git a/SteamStorefrontAPI/Endpoints/FeaturedCategories.cs b/SteamStorefrontAPI/Endpoints/FeaturedCategories.cs index fa87bb1..4a47839 100644 --- a/SteamStorefrontAPI/Endpoints/FeaturedCategories.cs +++ b/SteamStorefrontAPI/Endpoints/FeaturedCategories.cs @@ -1,44 +1,54 @@ -using Newtonsoft.Json.Linq; -using SteamStorefrontAPI.Classes; -using System; -using System.Collections.Generic; -using System.Linq; +using System.Collections.Generic; using System.Net.Http; -using System.Text; using System.Threading.Tasks; +using Newtonsoft.Json.Linq; +using SteamStorefrontAPI.Classes; namespace SteamStorefrontAPI { /// - /// Endpoint returning a list of featured items, grouped by category, in the steam store. + /// Endpoint returning a list of featured items, grouped by category, in the steam store. + /// public static class FeaturedCategories { private static HttpClient client = new HttpClient(); private const string steamBaseUri = "https://store.steampowered.com/api/featuredcategories"; /// - /// Retrieves a list of featured items, grouped by category, via an asynchronous operation. + /// Retrieves a list of featured items, grouped by category, via an asynchronous operation. + /// public static async Task> GetAsync() { return await GetAsync(null, null); } /// - /// Retrieves a list of featured items, grouped by category, via an asynchronous operation. - /// Two letter country code to customise currency and date values. + /// Retrieves a list of featured items, grouped by category, via an asynchronous operation. + /// + /// + /// Two letter country code to customise currency and date values. + /// public static async Task> GetAsync(string CountryCode) { return await GetAsync(CountryCode, null); } /// - /// Retrieves a list of featured items, grouped by category, via an asynchronous operation. - /// Two letter country code to customise currency and date values. - /// Full name of the language in english used for string localization e.g. name, description. - public static async Task> GetAsync(string CountryCode, string Language) + /// Retrieves a list of featured items, grouped by category, via an asynchronous operation. + /// + /// Two letter country code to customise currency and date values. + /// + /// + /// Full name of the language in english used for string localization e.g. name, + /// description. + /// + public static async Task> GetAsync(string CountryCode, + string Language) { string steamUri = steamBaseUri; - steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}?cc={CountryCode}"; + steamUri = string.IsNullOrWhiteSpace(CountryCode) + ? steamUri + : $"{steamUri}?cc={CountryCode}"; if (!string.IsNullOrWhiteSpace(Language)) { diff --git a/SteamStorefrontAPI/Endpoints/PackageDetails.cs b/SteamStorefrontAPI/Endpoints/PackageDetails.cs index 9ff99ef..0aabeff 100644 --- a/SteamStorefrontAPI/Endpoints/PackageDetails.cs +++ b/SteamStorefrontAPI/Endpoints/PackageDetails.cs @@ -1,23 +1,21 @@ -using Newtonsoft.Json.Linq; -using SteamStorefrontAPI.Classes; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Http; -using System.Text; +using System.Net.Http; using System.Threading.Tasks; +using Newtonsoft.Json.Linq; +using SteamStorefrontAPI.Classes; namespace SteamStorefrontAPI { /// - /// Endpoint returning details for a package in the steam store. + /// Endpoint returning details for a package in the steam store. + /// public static class PackageDetails { - private static HttpClient client = new HttpClient(); + private static readonly HttpClient client = new HttpClient(); private const string steamBaseUri = "http://store.steampowered.com/api/packagedetails"; /// - /// Retrieves details for the specified package via an asynchronous operation. + /// Retrieves details for the specified package via an asynchronous operation. + /// /// Steam package ID. public static async Task GetAsync(int PackageId) { @@ -25,24 +23,39 @@ namespace SteamStorefrontAPI } /// - /// Retrieves details for the specified package via an asynchronous operation. + /// Retrieves details for the specified package via an asynchronous operation. + /// /// Steam package ID. - /// Two letter country code to customise currency and date values. + /// + /// Two letter country code to customise currency and date values. + /// public static async Task GetAsync(int PackageId, string CountryCode) { return await GetAsync(PackageId, CountryCode, null); } /// - /// Retrieves details for the specified package via an asynchronous operation. + /// Retrieves details for the specified package via an asynchronous operation. + /// /// Steam package ID. - /// Two letter country code to customise currency and date values. - /// Full name of the language in english used for string localization e.g. title, description, release dates. - public static async Task GetAsync(int PackageId, string CountryCode, string Language) + /// + /// Two letter country code to customise currency and date values. + /// + /// + /// Full name of the language in english used for string localization e.g. title, + /// description, release dates. + /// + public static async Task GetAsync(int PackageId, string CountryCode, + string Language) { string steamUri = $"{steamBaseUri}?packageids={PackageId}"; - steamUri = string.IsNullOrWhiteSpace(CountryCode) ? steamUri : $"{steamUri}&cc={CountryCode}"; - steamUri = string.IsNullOrWhiteSpace(Language) ? steamUri : $"{steamUri}&l={Language.ToLower()}"; + steamUri = string.IsNullOrWhiteSpace(CountryCode) + ? steamUri + : $"{steamUri}&cc={CountryCode}"; + + steamUri = string.IsNullOrWhiteSpace(Language) + ? steamUri + : $"{steamUri}&l={Language.ToLower()}"; var response = await client.GetAsync(steamUri); if (!response.IsSuccessStatusCode) { return null; } diff --git a/SteamStorefrontConsole/Program.cs b/SteamStorefrontConsole/Program.cs index 13c65cb..f281dbb 100644 --- a/SteamStorefrontConsole/Program.cs +++ b/SteamStorefrontConsole/Program.cs @@ -1,10 +1,8 @@ -using SteamStorefrontAPI; -using SteamStorefrontAPI.Classes; -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; +using SteamStorefrontAPI; +using SteamStorefrontAPI.Classes; namespace SteamStorefrontConsole