From cce81fc5db311d7be635f29fea4b0d3caf191a25 Mon Sep 17 00:00:00 2001 From: Justin Date: Tue, 25 Feb 2020 12:04:55 -0500 Subject: [PATCH] General cleanup. --- src/SteamWebAPI2/AutoMapperConfiguration.cs | 47 +++++++++---------- src/SteamWebAPI2/Interfaces/DOTA2Econ.cs | 3 +- src/SteamWebAPI2/Interfaces/DOTA2Match.cs | 2 - src/SteamWebAPI2/Interfaces/EconItems.cs | 16 +++---- src/SteamWebAPI2/Interfaces/EconService.cs | 6 +-- src/SteamWebAPI2/Interfaces/GCVersion.cs | 4 +- src/SteamWebAPI2/Interfaces/IEconItems.cs | 7 ++- src/SteamWebAPI2/Interfaces/PlayerService.cs | 3 +- src/SteamWebAPI2/Interfaces/SteamApps.cs | 3 +- src/SteamWebAPI2/Interfaces/SteamEconomy.cs | 5 +- src/SteamWebAPI2/Interfaces/SteamNews.cs | 2 +- .../Interfaces/SteamRemoteStorage.cs | 6 ++- src/SteamWebAPI2/Interfaces/SteamStore.cs | 2 +- src/SteamWebAPI2/Interfaces/SteamUser.cs | 10 ++-- src/SteamWebAPI2/Interfaces/SteamUserStats.cs | 5 +- .../Interfaces/SteamWebAPIUtil.cs | 5 +- src/SteamWebAPI2/Interfaces/TFItems.cs | 3 +- .../Models/DOTA2/GameItemResultContainer.cs | 2 +- .../Models/DOTA2/HeroResultContainer.cs | 2 +- .../DOTA2/LiveLeagueGameResultContainer.cs | 1 - .../GameEconomy/SchemaItemResultContainer.cs | 5 +- .../SchemaOverviewResultContainer.cs | 11 ++++- .../GameEconomy/SchemaResultContainer.cs | 2 +- .../PublishedFileDetailsResultContainer.cs | 7 ++- .../SteamCommunity/SteamCommunityProfile.cs | 33 ++++++++----- .../CancelTradeOfferResultContainer.cs | 9 +--- .../DeclineTradeOfferResultContainer.cs | 9 +--- src/SteamWebAPI2/Models/SteamId.cs | 8 ++-- .../Models/SteamStore/AppDetailsContainer.cs | 2 +- src/SteamWebAPI2/SteamStoreInterface.cs | 13 +++-- src/SteamWebAPI2/SteamStoreRequest.cs | 18 +++---- .../JsonConverters/TagsJsonConverter.cs | 7 ++- .../Utilities/SteamWebInterface.cs | 12 ++--- .../Utilities/SteamWebInterfaceFactory.cs | 8 ++-- src/SteamWebAPI2/Utilities/SteamWebRequest.cs | 3 +- .../Utilities/SteamWebRequestParameter.cs | 8 ++-- .../SteamWebRequestParameterExtensions.cs | 5 +- 37 files changed, 142 insertions(+), 152 deletions(-) diff --git a/src/SteamWebAPI2/AutoMapperConfiguration.cs b/src/SteamWebAPI2/AutoMapperConfiguration.cs index a304f91..b0408e3 100644 --- a/src/SteamWebAPI2/AutoMapperConfiguration.cs +++ b/src/SteamWebAPI2/AutoMapperConfiguration.cs @@ -28,9 +28,7 @@ internal static class AutoMapperConfiguration { private static bool isInitialized = false; private static MapperConfiguration config; - private static IMapper mapper; - - public static IMapper Mapper { get { return mapper; } } + public static IMapper Mapper { get; private set; } private static SteamWebResponse ConstructSteamWebResponse(ISteamWebResponse response) { @@ -180,7 +178,7 @@ public static void Initialize() x.CreateMap().ConvertUsing(src => src.Result != null ? src.Result.PrizePool : default(uint)); - #endregion + #endregion Endpoint: DOTA2Econ #region Endpoint: DOTA2Fantasy @@ -193,7 +191,7 @@ public static void Initialize() x.CreateMap(); x.CreateMap(); - #endregion + #endregion Endpoint: DOTA2Fantasy #region Endpoint: DOTA2Match @@ -253,7 +251,7 @@ public static void Initialize() src => Mapper.Map, IReadOnlyCollection>(src.Result != null ? src.Result.Teams : null) ); - #endregion + #endregion Endpoint: DOTA2Match #region Endpoint: EconService @@ -284,7 +282,7 @@ public static void Initialize() src => Mapper.Map(src.Result) ); - #endregion + #endregion Endpoint: EconService #region Endpoint: GCVersion @@ -293,7 +291,7 @@ public static void Initialize() src => Mapper.Map(src.Result) ); - #endregion + #endregion Endpoint: GCVersion #region Endpoint: PlayerService @@ -347,7 +345,7 @@ public static void Initialize() src => Mapper.Map(src.Result) ); - #endregion + #endregion Endpoint: PlayerService #region Endpoint: SteamApps @@ -361,7 +359,7 @@ public static void Initialize() src => Mapper.Map(src.Result) ); - #endregion + #endregion Endpoint: SteamApps #region Endpoint: SteamNews @@ -371,7 +369,7 @@ public static void Initialize() src => Mapper.Map(src.Result) ); - #endregion + #endregion Endpoint: SteamNews #region Endpoint: SteamRemoteStorage @@ -399,7 +397,7 @@ public static void Initialize() src => Mapper.Map(src.Result) ); - #endregion + #endregion Endpoint: SteamRemoteStorage #region Endpoint: SteamUser @@ -429,7 +427,7 @@ public static void Initialize() x.CreateMap().ConvertUsing(src => src.Result != null ? src.Result.SteamId : default(ulong)); - #endregion + #endregion Endpoint: SteamUser #region Endpoint: SteamUserStats @@ -465,7 +463,7 @@ public static void Initialize() src => Mapper.Map(src.Result) ); - #endregion + #endregion Endpoint: SteamUserStats #region Endpoint: SteamWebAPIUtil @@ -478,7 +476,7 @@ public static void Initialize() src => Mapper.Map, IReadOnlyCollection>(src.Result != null ? src.Result.Interfaces : null) ); - #endregion + #endregion Endpoint: SteamWebAPIUtil #region Endpoint: TFItems @@ -487,7 +485,7 @@ public static void Initialize() src => Mapper.Map, IReadOnlyCollection>(src.Result != null ? src.Result.GoldenWrenches : null) ); - #endregion + #endregion Endpoint: TFItems #region Endpoint: SteamEconomy @@ -513,7 +511,7 @@ public static void Initialize() src => Mapper.Map(src.Result) ); - #endregion + #endregion Endpoint: SteamEconomy x.CreateMap().ConvertUsing(src => src.Result != null ? src.Result.ItemsGameUrl : null); @@ -592,7 +590,7 @@ public static void Initialize() x.CreateMap(); x.CreateMap(); - #endregion + #endregion Endpoint: SteamStore x.CreateMap() .ForMember(dest => dest.GameIcon, opts => opts.MapFrom(source => source.GameIcon)) @@ -607,7 +605,7 @@ public static void Initialize() .ForMember(dest => dest.Logo, opts => opts.MapFrom(source => new Uri(source.GameLogo))) .ForMember(dest => dest.LogoSmall, opts => opts.MapFrom(source => new Uri(source.GameLogoSmall))) .ForMember(dest => dest.Name, opts => opts.MapFrom(source => source.GameName)) - .ForMember(dest => dest.HoursOnRecord, opts => opts.MapFrom(source => !String.IsNullOrEmpty(source.HoursOnRecord) ? double.Parse(source.HoursOnRecord) : 0d)) + .ForMember(dest => dest.HoursOnRecord, opts => opts.MapFrom(source => !string.IsNullOrEmpty(source.HoursOnRecord) ? double.Parse(source.HoursOnRecord) : 0d)) .ForMember(dest => dest.HoursPlayed, opts => opts.MapFrom(source => (double)source.HoursPlayed)) .ForMember(dest => dest.StatsName, opts => opts.MapFrom(source => source.StatsName)); @@ -625,7 +623,7 @@ public static void Initialize() .ForMember(dest => dest.State, opts => opts.MapFrom(source => source.OnlineState)) .ForMember(dest => dest.StateMessage, opts => opts.MapFrom(source => source.StateMessage)) .ForMember(dest => dest.SteamID, opts => opts.MapFrom(source => source.SteamID64)) - .ForMember(dest => dest.SteamRating, opts => opts.MapFrom(source => !String.IsNullOrEmpty(source.SteamRating) ? double.Parse(source.SteamRating) : 0d)) + .ForMember(dest => dest.SteamRating, opts => opts.MapFrom(source => !string.IsNullOrEmpty(source.SteamRating) ? double.Parse(source.SteamRating) : 0d)) .ForMember(dest => dest.Summary, opts => opts.MapFrom(source => source.Summary)) .ForMember(dest => dest.TradeBanState, opts => opts.MapFrom(source => source.TradeBanState)) .ForMember(dest => dest.IsVacBanned, opts => opts.MapFrom(source => source.VacBanned == 1 ? true : false)) @@ -633,12 +631,11 @@ public static void Initialize() .ForMember(dest => dest.InGameServerIP, opts => opts.MapFrom(source => source.InGameServerIP)) .ForMember(dest => dest.InGameInfo, opts => opts.MapFrom(source => source.InGameInfo)); }); - } - if (mapper == null) + if (Mapper == null) { - mapper = config.CreateMapper(); + Mapper = config.CreateMapper(); } isInitialized = true; @@ -651,7 +648,7 @@ public static void Initialize() public static void Reset() { config = null; - mapper = null; + Mapper = null; } } -} +} \ No newline at end of file diff --git a/src/SteamWebAPI2/Interfaces/DOTA2Econ.cs b/src/SteamWebAPI2/Interfaces/DOTA2Econ.cs index e0eb051..a46611c 100644 --- a/src/SteamWebAPI2/Interfaces/DOTA2Econ.cs +++ b/src/SteamWebAPI2/Interfaces/DOTA2Econ.cs @@ -3,7 +3,6 @@ using SteamWebAPI2.Utilities; using System; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; namespace SteamWebAPI2.Interfaces @@ -74,7 +73,7 @@ public async Task>> GetHeroesAs /// public async Task> GetItemIconPathAsync(string iconName, string iconType = "") { - if (String.IsNullOrEmpty(iconName)) + if (string.IsNullOrEmpty(iconName)) { throw new ArgumentNullException("iconName"); } diff --git a/src/SteamWebAPI2/Interfaces/DOTA2Match.cs b/src/SteamWebAPI2/Interfaces/DOTA2Match.cs index fa4f9bc..d94fece 100644 --- a/src/SteamWebAPI2/Interfaces/DOTA2Match.cs +++ b/src/SteamWebAPI2/Interfaces/DOTA2Match.cs @@ -2,8 +2,6 @@ using SteamWebAPI2.Models.DOTA2; using SteamWebAPI2.Utilities; using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; using System.Threading.Tasks; namespace SteamWebAPI2.Interfaces diff --git a/src/SteamWebAPI2/Interfaces/EconItems.cs b/src/SteamWebAPI2/Interfaces/EconItems.cs index 8edec42..53c7c1d 100644 --- a/src/SteamWebAPI2/Interfaces/EconItems.cs +++ b/src/SteamWebAPI2/Interfaces/EconItems.cs @@ -92,9 +92,9 @@ public async Task> GetPlayerItemsAsync(ul /// public async Task> GetSchemaItemsForTF2Async(string language = "en_us") { - if (this.appId != (int)EconItemsAppId.TeamFortress2) + if (appId != (int)EconItemsAppId.TeamFortress2) { - throw new InvalidOperationException(String.Format("AppId {0} is not valid for the GetSchemaTF2 method.", appId)); + throw new InvalidOperationException(string.Format("AppId {0} is not valid for the GetSchemaTF2 method.", appId)); } List parameters = new List(); @@ -106,16 +106,16 @@ public async Task> GetSchemaItemsF return steamWebResponse; } - /// + /// /// Returns the schema overview for TF2 specifically. /// /// /// public async Task> GetSchemaOverviewForTF2Async(string language = "en_us") { - if (this.appId != (int)EconItemsAppId.TeamFortress2) + if (appId != (int)EconItemsAppId.TeamFortress2) { - throw new InvalidOperationException(String.Format("AppId {0} is not valid for the GetSchemaTF2 method.", appId)); + throw new InvalidOperationException(string.Format("AppId {0} is not valid for the GetSchemaTF2 method.", appId)); } List parameters = new List(); @@ -135,7 +135,7 @@ public async Task> GetSchemaUrlAsync() { if (!validSchemaUrlAppIds.Contains(appId)) { - throw new InvalidOperationException(String.Format("AppId {0} is not valid for the GetSchemaUrl method.", appId)); + throw new InvalidOperationException(string.Format("AppId {0} is not valid for the GetSchemaUrl method.", appId)); } var steamWebResponse = await steamWebInterface.GetAsync("GetSchemaURL", 1); @@ -154,7 +154,7 @@ public async Task> GetStoreMetaDataAsync(s { if (!validStoreMetaDataAppIds.Contains(appId)) { - throw new InvalidOperationException(String.Format("AppId {0} is not valid for the GetStoreMetaData method.", appId)); + throw new InvalidOperationException(string.Format("AppId {0} is not valid for the GetStoreMetaData method.", appId)); } List parameters = new List(); @@ -176,7 +176,7 @@ public async Task> GetStoreStatusAsync() { if (!validStoreStatusAppIds.Contains(appId)) { - throw new InvalidOperationException(String.Format("AppId {0} is not valid for the GetStoreStatus method.", appId)); + throw new InvalidOperationException(string.Format("AppId {0} is not valid for the GetStoreStatus method.", appId)); } var steamWebResponse = await steamWebInterface.GetAsync("GetStoreStatus", 1); diff --git a/src/SteamWebAPI2/Interfaces/EconService.cs b/src/SteamWebAPI2/Interfaces/EconService.cs index 29541a7..24fb803 100644 --- a/src/SteamWebAPI2/Interfaces/EconService.cs +++ b/src/SteamWebAPI2/Interfaces/EconService.cs @@ -48,7 +48,7 @@ public EconService(ISteamWebRequest steamWebRequest, ISteamWebInterface steamWeb var steamWebResponse = await steamWebInterface.GetAsync("GetTradeHistory", 1, parameters); var steamWebResponseModel = AutoMapperConfiguration.Mapper.Map< - ISteamWebResponse, + ISteamWebResponse, ISteamWebResponse>(steamWebResponse); return steamWebResponseModel; @@ -83,7 +83,7 @@ public EconService(ISteamWebRequest steamWebRequest, ISteamWebInterface steamWeb var steamWebResponse = await steamWebInterface.GetAsync("GetTradeOffers", 1, parameters); var steamWebResponseModel = AutoMapperConfiguration.Mapper.Map< - ISteamWebResponse, + ISteamWebResponse, ISteamWebResponse>(steamWebResponse); return steamWebResponseModel; @@ -105,7 +105,7 @@ public EconService(ISteamWebRequest steamWebRequest, ISteamWebInterface steamWeb var steamWebResponse = await steamWebInterface.GetAsync("GetTradeOffer", 1, parameters); var steamWebResponseModel = AutoMapperConfiguration.Mapper.Map< - ISteamWebResponse, + ISteamWebResponse, ISteamWebResponse>(steamWebResponse); return steamWebResponseModel; diff --git a/src/SteamWebAPI2/Interfaces/GCVersion.cs b/src/SteamWebAPI2/Interfaces/GCVersion.cs index c4c152b..cd42626 100644 --- a/src/SteamWebAPI2/Interfaces/GCVersion.cs +++ b/src/SteamWebAPI2/Interfaces/GCVersion.cs @@ -59,7 +59,7 @@ public async Task> GetClientVersionAsyn { if (!validClientVersionAppIds.Contains(appId)) { - throw new InvalidOperationException(String.Format("AppId {0} is not valid for the GetClientVersion method.", appId)); + throw new InvalidOperationException(string.Format("AppId {0} is not valid for the GetClientVersion method.", appId)); } var steamWebResponse = await steamWebInterface.GetAsync("GetClientVersion", 1); @@ -77,7 +77,7 @@ public async Task> GetServerVersionAsyn { if (!validServerVersionAppIds.Contains(appId)) { - throw new InvalidOperationException(String.Format("AppId {0} is not valid for the GetServerVersion method.", appId)); + throw new InvalidOperationException(string.Format("AppId {0} is not valid for the GetServerVersion method.", appId)); } var steamWebResponse = await steamWebInterface.GetAsync("GetServerVersion", 1); diff --git a/src/SteamWebAPI2/Interfaces/IEconItems.cs b/src/SteamWebAPI2/Interfaces/IEconItems.cs index 88c1861..264612c 100644 --- a/src/SteamWebAPI2/Interfaces/IEconItems.cs +++ b/src/SteamWebAPI2/Interfaces/IEconItems.cs @@ -1,5 +1,4 @@ -using Steam.Models.DOTA2; -using Steam.Models.GameEconomy; +using Steam.Models.GameEconomy; using SteamWebAPI2.Utilities; using System.Threading.Tasks; @@ -10,7 +9,7 @@ public interface IEconItems Task> GetPlayerItemsAsync(ulong steamId); Task> GetSchemaItemsForTF2Async(string language = "en_us"); - + Task> GetSchemaOverviewForTF2Async(string language = "en_us"); Task> GetSchemaUrlAsync(); @@ -19,4 +18,4 @@ public interface IEconItems Task> GetStoreStatusAsync(); } -} +} \ No newline at end of file diff --git a/src/SteamWebAPI2/Interfaces/PlayerService.cs b/src/SteamWebAPI2/Interfaces/PlayerService.cs index 2a1befd..2b1071e 100644 --- a/src/SteamWebAPI2/Interfaces/PlayerService.cs +++ b/src/SteamWebAPI2/Interfaces/PlayerService.cs @@ -3,7 +3,6 @@ using SteamWebAPI2.Models.SteamCommunity; using SteamWebAPI2.Models.SteamPlayer; using SteamWebAPI2.Utilities; -using System; using System.Collections.Generic; using System.Net; using System.Threading.Tasks; @@ -173,7 +172,7 @@ public async Task> GetOwnedGamesAsync(u { foreach (var ownedGame in steamWebResponse.Data.Result.OwnedGames) { - if (!String.IsNullOrWhiteSpace(ownedGame.Name)) + if (!string.IsNullOrWhiteSpace(ownedGame.Name)) { ownedGame.Name = ownedGame.Name.Trim(); } diff --git a/src/SteamWebAPI2/Interfaces/SteamApps.cs b/src/SteamWebAPI2/Interfaces/SteamApps.cs index b5a859a..c21269f 100644 --- a/src/SteamWebAPI2/Interfaces/SteamApps.cs +++ b/src/SteamWebAPI2/Interfaces/SteamApps.cs @@ -2,7 +2,6 @@ using SteamWebAPI2.Models; using SteamWebAPI2.Utilities; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.Threading.Tasks; namespace SteamWebAPI2.Interfaces @@ -53,7 +52,7 @@ public async Task> UpToDateCheckAs var steamWebResponse = await steamWebInterface.GetAsync("UpToDateCheck", 1, parameters); var steamWebResponseModel = AutoMapperConfiguration.Mapper.Map< - ISteamWebResponse, + ISteamWebResponse, ISteamWebResponse>(steamWebResponse); return steamWebResponseModel; diff --git a/src/SteamWebAPI2/Interfaces/SteamEconomy.cs b/src/SteamWebAPI2/Interfaces/SteamEconomy.cs index 894c0b6..50a866f 100644 --- a/src/SteamWebAPI2/Interfaces/SteamEconomy.cs +++ b/src/SteamWebAPI2/Interfaces/SteamEconomy.cs @@ -1,7 +1,6 @@ using Steam.Models.SteamEconomy; using SteamWebAPI2.Models.SteamEconomy; using SteamWebAPI2.Utilities; -using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -39,7 +38,7 @@ public async Task> GetAssetClassInf for (int i = 0; i < classIds.Count; i++) { - parameters.AddIfHasValue(classIds[i], String.Format("classid{0}", i)); + parameters.AddIfHasValue(classIds[i], string.Format("classid{0}", i)); } var steamWebResponse = await steamWebInterface.GetAsync("GetAssetClassInfo", 1, parameters); @@ -69,7 +68,7 @@ public async Task> GetAssetPricesAsync( var steamWebResponse = await steamWebInterface.GetAsync("GetAssetPrices", 1, parameters); var steamWebResponseModel = AutoMapperConfiguration.Mapper.Map< - ISteamWebResponse, + ISteamWebResponse, ISteamWebResponse>(steamWebResponse); return steamWebResponseModel; diff --git a/src/SteamWebAPI2/Interfaces/SteamNews.cs b/src/SteamWebAPI2/Interfaces/SteamNews.cs index 7ba2ec2..a5ed20e 100644 --- a/src/SteamWebAPI2/Interfaces/SteamNews.cs +++ b/src/SteamWebAPI2/Interfaces/SteamNews.cs @@ -49,7 +49,7 @@ public async Task> GetNewsForAppAsync(ui var steamWebResponse = await steamWebInterface.GetAsync("GetNewsForApp", 2, parameters); var steamWebResponseModel = AutoMapperConfiguration.Mapper.Map< - ISteamWebResponse, + ISteamWebResponse, ISteamWebResponse>(steamWebResponse); return steamWebResponseModel; diff --git a/src/SteamWebAPI2/Interfaces/SteamRemoteStorage.cs b/src/SteamWebAPI2/Interfaces/SteamRemoteStorage.cs index 812b0d6..4f13dff 100644 --- a/src/SteamWebAPI2/Interfaces/SteamRemoteStorage.cs +++ b/src/SteamWebAPI2/Interfaces/SteamRemoteStorage.cs @@ -34,7 +34,8 @@ public SteamRemoteStorage(ISteamWebRequest steamWebRequest, ISteamWebInterface s /// A collection of the details of each file or null if the request failed. /// Thrown when is null. /// Thrown when is empty or is greater than the number of elements in . - public async Task>> GetPublishedFileDetailsAsync(uint itemCount, IList publishedFileIds) { + public async Task>> GetPublishedFileDetailsAsync(uint itemCount, IList publishedFileIds) + { if (publishedFileIds == null) { throw new ArgumentNullException(nameof(publishedFileIds)); @@ -132,7 +133,8 @@ public async Task> GetUGCFileDetailsAsync /// The type to which to map the data of the response. /// The parameters of the request. /// The response of the request to the API or null if the request failed. - private async Task> GetPublishedFileDetailsAsync(IList parameters) { + private async Task> GetPublishedFileDetailsAsync(IList parameters) + { try { var steamWebResponse = await steamWebInterface.PostAsync("GetPublishedFileDetails", 1, parameters); diff --git a/src/SteamWebAPI2/Interfaces/SteamStore.cs b/src/SteamWebAPI2/Interfaces/SteamStore.cs index 5973b5f..05aa8c8 100644 --- a/src/SteamWebAPI2/Interfaces/SteamStore.cs +++ b/src/SteamWebAPI2/Interfaces/SteamStore.cs @@ -61,4 +61,4 @@ public async Task GetStoreFeaturedProductsAsync() return featuredProductsModel; } } -} +} \ No newline at end of file diff --git a/src/SteamWebAPI2/Interfaces/SteamUser.cs b/src/SteamWebAPI2/Interfaces/SteamUser.cs index c85b8bd..e15c548 100644 --- a/src/SteamWebAPI2/Interfaces/SteamUser.cs +++ b/src/SteamWebAPI2/Interfaces/SteamUser.cs @@ -3,9 +3,7 @@ using SteamWebAPI2.Models.SteamCommunity; using SteamWebAPI2.Models.SteamPlayer; using SteamWebAPI2.Utilities; -using System; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.IO; using System.Linq; using System.Net.Http; @@ -121,14 +119,14 @@ public async Task>> GetPl { List parameters = new List(); - string steamIdsParamValue = String.Join(",", steamIds); + string steamIdsParamValue = string.Join(",", steamIds); parameters.AddIfHasValue(steamIdsParamValue, "steamids"); var steamWebResponse = await steamWebInterface.GetAsync("GetPlayerBans", 1, parameters); var steamWebResponseModel = AutoMapperConfiguration.Mapper.Map< - ISteamWebResponse, + ISteamWebResponse, ISteamWebResponse>>(steamWebResponse); return steamWebResponseModel; @@ -173,7 +171,7 @@ public async Task> ResolveVanityUrlAsync(string vanityU { throw new VanityUrlNotResolvedException(ErrorMessages.VanityUrlNotResolved); } - + var steamWebResponseModel = AutoMapperConfiguration.Mapper.Map< ISteamWebResponse, ISteamWebResponse>(steamWebResponse); @@ -189,7 +187,7 @@ public async Task> ResolveVanityUrlAsync(string vanityU public async Task GetCommunityProfileAsync(ulong steamId) { HttpClient httpClient = new HttpClient(); - string xml = await httpClient.GetStringAsync(String.Format("http://steamcommunity.com/profiles/{0}?xml=1", steamId)); + string xml = await httpClient.GetStringAsync(string.Format("http://steamcommunity.com/profiles/{0}?xml=1", steamId)); var profile = DeserializeXML(xml); diff --git a/src/SteamWebAPI2/Interfaces/SteamUserStats.cs b/src/SteamWebAPI2/Interfaces/SteamUserStats.cs index 375c0d7..0994daf 100644 --- a/src/SteamWebAPI2/Interfaces/SteamUserStats.cs +++ b/src/SteamWebAPI2/Interfaces/SteamUserStats.cs @@ -7,7 +7,6 @@ using SteamWebAPI2.Utilities; using System; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.Threading.Tasks; namespace SteamWebAPI2.Interfaces @@ -77,7 +76,7 @@ public async Task>> GetGl for (int i = 0; i < statNames.Count; i++) { - parameters.AddIfHasValue(statNames[i], String.Format("name[{0}]", i)); + parameters.AddIfHasValue(statNames[i], string.Format("name[{0}]", i)); } var steamWebResponse = await steamWebInterface.GetAsync("GetGlobalStatsForGame", 1, parameters); @@ -167,7 +166,7 @@ public async Task> GetUserStatsFo var steamWebResponse = await steamWebInterface.GetAsync("GetUserStatsForGame", 2, parameters); var steamWebResponseModel = AutoMapperConfiguration.Mapper.Map< - ISteamWebResponse, + ISteamWebResponse, ISteamWebResponse>(steamWebResponse); return steamWebResponseModel; diff --git a/src/SteamWebAPI2/Interfaces/SteamWebAPIUtil.cs b/src/SteamWebAPI2/Interfaces/SteamWebAPIUtil.cs index cd88e8e..4ad59c3 100644 --- a/src/SteamWebAPI2/Interfaces/SteamWebAPIUtil.cs +++ b/src/SteamWebAPI2/Interfaces/SteamWebAPIUtil.cs @@ -2,7 +2,6 @@ using SteamWebAPI2.Models; using SteamWebAPI2.Utilities; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.Threading.Tasks; namespace SteamWebAPI2.Interfaces @@ -31,7 +30,7 @@ public async Task> GetServerInfoAsync() var steamServerInfo = await steamWebInterface.GetAsync("GetServerInfo", 1); var steamServerInfoModel = AutoMapperConfiguration.Mapper.Map< - ISteamWebResponse, + ISteamWebResponse, ISteamWebResponse>(steamServerInfo); return steamServerInfoModel; @@ -46,7 +45,7 @@ public async Task>> G var steamWebResponse = await steamWebInterface.GetAsync("GetSupportedAPIList", 1); var steamWebResponseModel = AutoMapperConfiguration.Mapper.Map< - ISteamWebResponse, + ISteamWebResponse, ISteamWebResponse>>(steamWebResponse); return steamWebResponseModel; diff --git a/src/SteamWebAPI2/Interfaces/TFItems.cs b/src/SteamWebAPI2/Interfaces/TFItems.cs index e6429d3..55ebd17 100644 --- a/src/SteamWebAPI2/Interfaces/TFItems.cs +++ b/src/SteamWebAPI2/Interfaces/TFItems.cs @@ -2,7 +2,6 @@ using SteamWebAPI2.Models.TF2; using SteamWebAPI2.Utilities; using System.Collections.Generic; -using System.Collections.ObjectModel; using System.Threading.Tasks; namespace SteamWebAPI2.Interfaces @@ -31,7 +30,7 @@ public async Task>> Get var steamWebResponse = await steamWebInterface.GetAsync("GetGoldenWrenches", 2); var steamWebResponseModel = AutoMapperConfiguration.Mapper.Map< - ISteamWebResponse, + ISteamWebResponse, ISteamWebResponse>>(steamWebResponse); return steamWebResponseModel; diff --git a/src/SteamWebAPI2/Models/DOTA2/GameItemResultContainer.cs b/src/SteamWebAPI2/Models/DOTA2/GameItemResultContainer.cs index 4f8c204..447bfa9 100644 --- a/src/SteamWebAPI2/Models/DOTA2/GameItemResultContainer.cs +++ b/src/SteamWebAPI2/Models/DOTA2/GameItemResultContainer.cs @@ -20,7 +20,7 @@ internal class GameItem [JsonProperty(PropertyName = "localized_name")] public string LocalizedName { get; set; } - public bool IsAvailableAtSecretShop { get { return SecretShop == 1 ? true : false; } } + public bool IsAvailableAtSecretShop { get { return SecretShop == 1 ? true : false; } } public bool IsAvailableAtSideShop { get { return SideShop == 1 ? true : false; } } public bool IsRecipe { get { return Recipe == 1 ? true : false; } } } diff --git a/src/SteamWebAPI2/Models/DOTA2/HeroResultContainer.cs b/src/SteamWebAPI2/Models/DOTA2/HeroResultContainer.cs index 8db2f7c..397d817 100644 --- a/src/SteamWebAPI2/Models/DOTA2/HeroResultContainer.cs +++ b/src/SteamWebAPI2/Models/DOTA2/HeroResultContainer.cs @@ -7,7 +7,7 @@ internal class Hero { public string Name { get; set; } public uint Id { get; set; } - + [JsonProperty(PropertyName = "localized_name")] public string LocalizedName { get; set; } } diff --git a/src/SteamWebAPI2/Models/DOTA2/LiveLeagueGameResultContainer.cs b/src/SteamWebAPI2/Models/DOTA2/LiveLeagueGameResultContainer.cs index 78b4b42..6d4f083 100644 --- a/src/SteamWebAPI2/Models/DOTA2/LiveLeagueGameResultContainer.cs +++ b/src/SteamWebAPI2/Models/DOTA2/LiveLeagueGameResultContainer.cs @@ -1,6 +1,5 @@ using Newtonsoft.Json; using Steam.Models.DOTA2; -using SteamWebAPI2.Interfaces; using System.Collections.Generic; namespace SteamWebAPI2.Models.DOTA2 diff --git a/src/SteamWebAPI2/Models/GameEconomy/SchemaItemResultContainer.cs b/src/SteamWebAPI2/Models/GameEconomy/SchemaItemResultContainer.cs index bd1bb66..1ced99c 100644 --- a/src/SteamWebAPI2/Models/GameEconomy/SchemaItemResultContainer.cs +++ b/src/SteamWebAPI2/Models/GameEconomy/SchemaItemResultContainer.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using Newtonsoft.Json; +using System.Collections.Generic; namespace SteamWebAPI2.Models.GameEconomy { @@ -7,10 +7,13 @@ public class SchemaItemsResult { [JsonProperty("status")] public uint Status { get; set; } + [JsonProperty("items_game_url")] public string ItemsGameUrl { get; set; } + [JsonProperty("items")] public IList Items { get; set; } + [JsonProperty("next")] public uint Next { get; set; } } diff --git a/src/SteamWebAPI2/Models/GameEconomy/SchemaOverviewResultContainer.cs b/src/SteamWebAPI2/Models/GameEconomy/SchemaOverviewResultContainer.cs index 1105c9f..a6b00fd 100644 --- a/src/SteamWebAPI2/Models/GameEconomy/SchemaOverviewResultContainer.cs +++ b/src/SteamWebAPI2/Models/GameEconomy/SchemaOverviewResultContainer.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; using Newtonsoft.Json; +using System.Collections.Generic; namespace SteamWebAPI2.Models.GameEconomy { @@ -7,22 +7,31 @@ public class SchemaOverviewResult { [JsonProperty("status")] public uint Status { get; set; } + [JsonProperty("items_game_url")] public string ItemsGameUrl { get; set; } + [JsonProperty("qualities")] public SchemaQualities Qualities { get; set; } + [JsonProperty("originNames")] public IList OriginNames { get; set; } + [JsonProperty("attributes")] public IList Attributes { get; set; } + [JsonProperty("item_sets")] public IList ItemSets { get; set; } + [JsonProperty("attribute_controlled_attached_particles")] public IList AttributeControlledAttachedParticles { get; set; } + [JsonProperty("item_levels")] public IList ItemLevels { get; set; } + [JsonProperty("kill_eater_score_types")] public IList KillEaterScoreTypes { get; set; } + [JsonProperty("string_lookups")] public IList StringLookups { get; set; } } diff --git a/src/SteamWebAPI2/Models/GameEconomy/SchemaResultContainer.cs b/src/SteamWebAPI2/Models/GameEconomy/SchemaResultContainer.cs index e89e0c1..814f28c 100644 --- a/src/SteamWebAPI2/Models/GameEconomy/SchemaResultContainer.cs +++ b/src/SteamWebAPI2/Models/GameEconomy/SchemaResultContainer.cs @@ -301,7 +301,7 @@ public class SchemaItem [JsonProperty("item_class")] public string ItemClass { get; set; } - + [JsonProperty("proper_name")] public bool ProperName { get; set; } diff --git a/src/SteamWebAPI2/Models/PublishedFileDetailsResultContainer.cs b/src/SteamWebAPI2/Models/PublishedFileDetailsResultContainer.cs index 46ee2be..83ca5f4 100644 --- a/src/SteamWebAPI2/Models/PublishedFileDetailsResultContainer.cs +++ b/src/SteamWebAPI2/Models/PublishedFileDetailsResultContainer.cs @@ -1,8 +1,7 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; -using Newtonsoft.Json; - namespace SteamWebAPI2.Models { using SteamWebAPI2.Utilities.JsonConverters; @@ -102,4 +101,4 @@ internal class PublishedFileDetails [JsonConverter(typeof(TagsJsonConverter))] public IList Tags { get; set; } } -} +} \ No newline at end of file diff --git a/src/SteamWebAPI2/Models/SteamCommunity/SteamCommunityProfile.cs b/src/SteamWebAPI2/Models/SteamCommunity/SteamCommunityProfile.cs index fd86cf5..9885ad1 100644 --- a/src/SteamWebAPI2/Models/SteamCommunity/SteamCommunityProfile.cs +++ b/src/SteamWebAPI2/Models/SteamCommunity/SteamCommunityProfile.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; +using System.Collections.Generic; using System.Runtime.Serialization; -using System.Xml.Serialization; namespace SteamWebAPI2.Models.SteamCommunity { @@ -37,7 +34,7 @@ internal class SteamCommunityProfile public string AvatarFull { get; set; } [DataMember(Name = "vacBanned", Order = 9)] - public byte VacBanned {get; set; } + public byte VacBanned { get; set; } [DataMember(Name = "tradeBanState", Order = 10)] public string TradeBanState { get; set; } @@ -158,36 +155,46 @@ internal class ProfileGroup [DataMember(Name = "memberCount", Order = 8)] public uint MemberCount { get; set; } - + public bool MemberCountSpecified { get; set; } [DataMember(Name = "membersInChat", Order = 9)] public uint MembersInChat { get; set; } - + public bool MembersInChatSpecified { get; set; } [DataMember(Name = "membersInGame", Order = 10)] public uint MembersInGame { get; set; } - + public bool MembersInGameSpecified { get; set; } [DataMember(Name = "membersOnline", Order = 11)] public uint MembersOnline { get; set; } - + public bool MembersOnlineSpecified { get; set; } } [CollectionDataContract(ItemName = "mostPlayedGame", Namespace = "")] internal class ProfileMostPlayedGameList : List { - public ProfileMostPlayedGameList() { } - public ProfileMostPlayedGameList(IEnumerable collection) : base(collection) { } + public ProfileMostPlayedGameList() + { + } + + public ProfileMostPlayedGameList(IEnumerable collection) : base(collection) + { + } } [CollectionDataContract(ItemName = "group", Namespace = "")] internal class ProfileGroupList : List { - public ProfileGroupList() { } - public ProfileGroupList(IEnumerable collection) : base(collection) { } + public ProfileGroupList() + { + } + + public ProfileGroupList(IEnumerable collection) : base(collection) + { + } } } \ No newline at end of file diff --git a/src/SteamWebAPI2/Models/SteamEconomy/CancelTradeOfferResultContainer.cs b/src/SteamWebAPI2/Models/SteamEconomy/CancelTradeOfferResultContainer.cs index cdee0ee..e59890c 100644 --- a/src/SteamWebAPI2/Models/SteamEconomy/CancelTradeOfferResultContainer.cs +++ b/src/SteamWebAPI2/Models/SteamEconomy/CancelTradeOfferResultContainer.cs @@ -1,15 +1,10 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace SteamWebAPI2.Models.SteamEconomy { internal class CancelTradeOfferResult { - // ?? + // ?? TBD? } internal class CancelTradeOfferResultContainer @@ -17,4 +12,4 @@ internal class CancelTradeOfferResultContainer [JsonProperty("response")] public CancelTradeOfferResult Result { get; set; } } -} +} \ No newline at end of file diff --git a/src/SteamWebAPI2/Models/SteamEconomy/DeclineTradeOfferResultContainer.cs b/src/SteamWebAPI2/Models/SteamEconomy/DeclineTradeOfferResultContainer.cs index e21e3be..e19279e 100644 --- a/src/SteamWebAPI2/Models/SteamEconomy/DeclineTradeOfferResultContainer.cs +++ b/src/SteamWebAPI2/Models/SteamEconomy/DeclineTradeOfferResultContainer.cs @@ -1,15 +1,10 @@ using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace SteamWebAPI2.Models.SteamEconomy { internal class DeclineTradeOfferResult { - // ?? + // ?? TBD? } internal class DeclineTradeOfferResultContainer @@ -17,4 +12,4 @@ internal class DeclineTradeOfferResultContainer [JsonProperty("response")] public DeclineTradeOfferResult Result { get; set; } } -} +} \ No newline at end of file diff --git a/src/SteamWebAPI2/Models/SteamId.cs b/src/SteamWebAPI2/Models/SteamId.cs index 16b05be..0930d01 100644 --- a/src/SteamWebAPI2/Models/SteamId.cs +++ b/src/SteamWebAPI2/Models/SteamId.cs @@ -224,7 +224,7 @@ public async Task ResolveAsync(string value) string accountTypeCharacter = modernCheckResult[0].Groups[1].Value; string universe = modernCheckResult[0].Groups[2].Value; string accountId = modernCheckResult[0].Groups[3].Value; - string instance = String.Empty; + string instance = string.Empty; if (modernCheckResult[0].Groups.Count == 5) { instance = modernCheckResult[0].Groups[4].Value; @@ -320,7 +320,7 @@ private void ConstructFromModernSteamId(string accountTypeCharacter, string inst else { Instance = SteamInstance.All; } // override if an instance was provided - if (!String.IsNullOrEmpty(instance)) + if (!string.IsNullOrEmpty(instance)) { Instance = (SteamInstance)uint.Parse(instance); } @@ -430,7 +430,7 @@ public string ToLegacyFormat() // Y = lowest bit of Account Id (always 0 or 1) uint y = AccountId & 1; - return String.Format("STEAM_{0}:{1}:{2}", x, y, z); + return string.Format("STEAM_{0}:{1}:{2}", x, y, z); } /// @@ -449,7 +449,7 @@ public string ToModernFormat() // A = account id uint a = AccountId; - return String.Format("[{0}:{1}:{2}]", c, u, a); + return string.Format("[{0}:{1}:{2}]", c, u, a); } /// diff --git a/src/SteamWebAPI2/Models/SteamStore/AppDetailsContainer.cs b/src/SteamWebAPI2/Models/SteamStore/AppDetailsContainer.cs index 68d9889..656109f 100644 --- a/src/SteamWebAPI2/Models/SteamStore/AppDetailsContainer.cs +++ b/src/SteamWebAPI2/Models/SteamStore/AppDetailsContainer.cs @@ -282,4 +282,4 @@ internal class AppDetailsContainer [JsonProperty("data")] public Data Data { get; set; } } -} +} \ No newline at end of file diff --git a/src/SteamWebAPI2/SteamStoreInterface.cs b/src/SteamWebAPI2/SteamStoreInterface.cs index a3d2777..66cf781 100644 --- a/src/SteamWebAPI2/SteamStoreInterface.cs +++ b/src/SteamWebAPI2/SteamStoreInterface.cs @@ -1,5 +1,4 @@ using SteamWebAPI2.Utilities; -using System; using System.Collections.Generic; using System.Diagnostics; using System.Net.Http; @@ -20,7 +19,7 @@ public abstract class SteamStoreInterface /// public SteamStoreInterface() { - this.steamStoreRequest = new SteamStoreRequest(steamStoreApiBaseUrl); + steamStoreRequest = new SteamStoreRequest(steamStoreApiBaseUrl); AutoMapperConfiguration.Initialize(); } @@ -31,7 +30,7 @@ public SteamStoreInterface() /// Client to make requests with public SteamStoreInterface(HttpClient httpClient) { - this.steamStoreRequest = new SteamStoreRequest(steamStoreApiBaseUrl, httpClient); + steamStoreRequest = new SteamStoreRequest(steamStoreApiBaseUrl, httpClient); AutoMapperConfiguration.Initialize(); } @@ -42,7 +41,7 @@ public SteamStoreInterface(HttpClient httpClient) /// Steam Store Web API URL public SteamStoreInterface(string steamStoreApiBaseUrl) { - this.steamStoreRequest = new SteamStoreRequest(steamStoreApiBaseUrl); + steamStoreRequest = new SteamStoreRequest(steamStoreApiBaseUrl); AutoMapperConfiguration.Initialize(); } @@ -54,7 +53,7 @@ public SteamStoreInterface(string steamStoreApiBaseUrl) /// Client to make requests with public SteamStoreInterface(string steamStoreApiBaseUrl, HttpClient httpClient) { - this.steamStoreRequest = new SteamStoreRequest(steamStoreApiBaseUrl, httpClient); + steamStoreRequest = new SteamStoreRequest(steamStoreApiBaseUrl, httpClient); AutoMapperConfiguration.Initialize(); } @@ -68,9 +67,9 @@ public SteamStoreInterface(string steamStoreApiBaseUrl, HttpClient httpClient) /// Deserialized response object internal async Task CallMethodAsync(string endpointName, IList parameters = null) { - Debug.Assert(!String.IsNullOrEmpty(endpointName)); + Debug.Assert(!string.IsNullOrEmpty(endpointName)); return await steamStoreRequest.SendStoreRequestAsync(endpointName, parameters); } } -} +} \ No newline at end of file diff --git a/src/SteamWebAPI2/SteamStoreRequest.cs b/src/SteamWebAPI2/SteamStoreRequest.cs index f6166cd..dd92ced 100644 --- a/src/SteamWebAPI2/SteamStoreRequest.cs +++ b/src/SteamWebAPI2/SteamStoreRequest.cs @@ -22,7 +22,7 @@ internal class SteamStoreRequest /// Steam Store Web API URL public SteamStoreRequest(string steamStoreApiBaseUrl) { - if (String.IsNullOrEmpty(steamStoreApiBaseUrl)) + if (string.IsNullOrEmpty(steamStoreApiBaseUrl)) { throw new ArgumentNullException("steamStoreApiBaseUrl"); } @@ -32,7 +32,7 @@ public SteamStoreRequest(string steamStoreApiBaseUrl) public SteamStoreRequest(string steamStoreApiBaseUrl, HttpClient httpClient) { - if (String.IsNullOrEmpty(steamStoreApiBaseUrl)) + if (string.IsNullOrEmpty(steamStoreApiBaseUrl)) { throw new ArgumentNullException("steamStoreApiBaseUrl"); } @@ -49,7 +49,7 @@ public SteamStoreRequest(string steamStoreApiBaseUrl, HttpClient httpClient) /// public async Task SendStoreRequestAsync(string endpointName) { - Debug.Assert(!String.IsNullOrEmpty(endpointName)); + Debug.Assert(!string.IsNullOrEmpty(endpointName)); return await SendStoreRequestAsync(endpointName, null); } @@ -63,7 +63,7 @@ public async Task SendStoreRequestAsync(string endpointName) /// Deserialized response object public async Task SendStoreRequestAsync(string endpointName, IList parameters) { - Debug.Assert(!String.IsNullOrEmpty(endpointName)); + Debug.Assert(!string.IsNullOrEmpty(endpointName)); if (parameters == null) { @@ -100,23 +100,23 @@ private async Task GetHttpStringResponseAsync(string command) /// Deserialized response object public string BuildRequestCommand(string endpointName, IList parameters) { - Debug.Assert(!String.IsNullOrEmpty(endpointName)); + Debug.Assert(!string.IsNullOrEmpty(endpointName)); if (steamStoreApiBaseUrl.EndsWith("/")) { steamStoreApiBaseUrl = steamStoreApiBaseUrl.Remove(steamStoreApiBaseUrl.Length - 1, 1); } - string commandUrl = String.Format("{0}/{1}/", steamStoreApiBaseUrl, endpointName); + string commandUrl = string.Format("{0}/{1}/", steamStoreApiBaseUrl, endpointName); // if we have parameters, join them together with & delimiter and append them to the command URL if (parameters != null && parameters.Count > 0) { - string parameterString = String.Join("&", parameters); - commandUrl += String.Format("?{0}", parameterString); + string parameterString = string.Join("&", parameters); + commandUrl += string.Format("?{0}", parameterString); } return commandUrl; } } -} +} \ No newline at end of file diff --git a/src/SteamWebAPI2/Utilities/JsonConverters/TagsJsonConverter.cs b/src/SteamWebAPI2/Utilities/JsonConverters/TagsJsonConverter.cs index 91a19a5..039f00d 100644 --- a/src/SteamWebAPI2/Utilities/JsonConverters/TagsJsonConverter.cs +++ b/src/SteamWebAPI2/Utilities/JsonConverters/TagsJsonConverter.cs @@ -1,9 +1,8 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Reflection; -using Newtonsoft.Json; - namespace SteamWebAPI2.Utilities.JsonConverters { /// @@ -35,4 +34,4 @@ public override bool CanConvert(Type objectType) return typeof(IList>).GetTypeInfo().IsAssignableFrom(objectType.GetTypeInfo()); } } -} +} \ No newline at end of file diff --git a/src/SteamWebAPI2/Utilities/SteamWebInterface.cs b/src/SteamWebAPI2/Utilities/SteamWebInterface.cs index ea418da..33d8933 100644 --- a/src/SteamWebAPI2/Utilities/SteamWebInterface.cs +++ b/src/SteamWebAPI2/Utilities/SteamWebInterface.cs @@ -23,11 +23,11 @@ internal sealed class SteamWebInterface : ISteamWebInterface /// is used to construct the URL to perform the GET or POST. public SteamWebInterface(string interfaceName, ISteamWebRequest steamWebRequest) { - if (String.IsNullOrWhiteSpace(interfaceName)) + if (string.IsNullOrWhiteSpace(interfaceName)) { throw new ArgumentNullException(nameof(interfaceName)); } - + if (steamWebRequest == null) { throw new ArgumentNullException(nameof(steamWebRequest)); @@ -49,11 +49,11 @@ public SteamWebInterface(string interfaceName, ISteamWebRequest steamWebRequest) public SteamWebInterface(string steamWebApiBaseUrl, string interfaceName, ISteamWebRequest steamWebRequest) : this(interfaceName, steamWebRequest) { - if (String.IsNullOrWhiteSpace(steamWebApiBaseUrl)) + if (string.IsNullOrWhiteSpace(steamWebApiBaseUrl)) { throw new ArgumentNullException(nameof(steamWebApiBaseUrl)); } - + this.steamWebApiBaseUrl = steamWebApiBaseUrl; } @@ -67,7 +67,7 @@ public SteamWebInterface(string steamWebApiBaseUrl, string interfaceName, ISteam /// public async Task> GetAsync(string methodName, int version, IList parameters = null) { - Debug.Assert(!String.IsNullOrWhiteSpace(methodName)); + Debug.Assert(!string.IsNullOrWhiteSpace(methodName)); Debug.Assert(version > 0); return await steamWebRequest.GetAsync(interfaceName, methodName, version, parameters); @@ -83,7 +83,7 @@ public async Task> GetAsync(string methodName, int versi /// public async Task> PostAsync(string methodName, int version, IList parameters = null) { - Debug.Assert(!String.IsNullOrWhiteSpace(methodName)); + Debug.Assert(!string.IsNullOrWhiteSpace(methodName)); Debug.Assert(version > 0); return await steamWebRequest.PostAsync(interfaceName, methodName, version, parameters); diff --git a/src/SteamWebAPI2/Utilities/SteamWebInterfaceFactory.cs b/src/SteamWebAPI2/Utilities/SteamWebInterfaceFactory.cs index 6b2e6dd..1304884 100644 --- a/src/SteamWebAPI2/Utilities/SteamWebInterfaceFactory.cs +++ b/src/SteamWebAPI2/Utilities/SteamWebInterfaceFactory.cs @@ -1,6 +1,6 @@ +using SteamWebAPI2.Interfaces; using System; using System.Net.Http; -using SteamWebAPI2.Interfaces; namespace SteamWebAPI2.Utilities { @@ -16,14 +16,14 @@ public class SteamWebInterfaceFactory /// Base URL of the Steam Web API (optional) public SteamWebInterfaceFactory(string steamWebApiKey, string steamWebApiBaseUrl = null) { - if(string.IsNullOrWhiteSpace(steamWebApiKey)) + if (string.IsNullOrWhiteSpace(steamWebApiKey)) { throw new ArgumentNullException(nameof(steamWebApiKey)); } this.steamWebApiKey = steamWebApiKey; - if(!string.IsNullOrWhiteSpace(steamWebApiBaseUrl)) + if (!string.IsNullOrWhiteSpace(steamWebApiBaseUrl)) { this.steamWebApiBaseUrl = steamWebApiBaseUrl; } @@ -41,7 +41,7 @@ public T CreateSteamWebInterface(HttpClient httpClient) return (T)Activator.CreateInstance(typeof(T), steamWebRequest, null); } - /// + /// /// Creates a web interface object connected to a specific Steam Web API interfac endpoint /// /// Custom http client injected with your customization (if necessary) diff --git a/src/SteamWebAPI2/Utilities/SteamWebRequest.cs b/src/SteamWebAPI2/Utilities/SteamWebRequest.cs index b31b610..147f8bf 100644 --- a/src/SteamWebAPI2/Utilities/SteamWebRequest.cs +++ b/src/SteamWebAPI2/Utilities/SteamWebRequest.cs @@ -116,11 +116,10 @@ private async Task> SendWebRequestAsync(HttpMethod httpM httpResponse = await httpClient.GetAsync(command).ConfigureAwait(false); httpResponse.EnsureSuccessStatusCode(); - if(httpResponse.Content == null) + if (httpResponse.Content == null) { httpResponse = new HttpResponseMessage(HttpStatusCode.NoContent); } - } else if (httpMethod == HttpMethod.POST) { diff --git a/src/SteamWebAPI2/Utilities/SteamWebRequestParameter.cs b/src/SteamWebAPI2/Utilities/SteamWebRequestParameter.cs index b70e891..c2efa1b 100644 --- a/src/SteamWebAPI2/Utilities/SteamWebRequestParameter.cs +++ b/src/SteamWebAPI2/Utilities/SteamWebRequestParameter.cs @@ -25,13 +25,13 @@ public class SteamWebRequestParameter /// Value to give this parameter public SteamWebRequestParameter(string name, string value) { - if (String.IsNullOrWhiteSpace(name)) + if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentNullException("name"); } - this.Name = name; - this.Value = value; + Name = name; + Value = value; } /// @@ -39,7 +39,7 @@ public SteamWebRequestParameter(string name, string value) /// public override string ToString() { - return String.Format("{0}={1}", Name, Value.ToString()); + return string.Format("{0}={1}", Name, Value.ToString()); } } } \ No newline at end of file diff --git a/src/SteamWebAPI2/Utilities/SteamWebRequestParameterExtensions.cs b/src/SteamWebAPI2/Utilities/SteamWebRequestParameterExtensions.cs index 0dfda27..af44925 100644 --- a/src/SteamWebAPI2/Utilities/SteamWebRequestParameterExtensions.cs +++ b/src/SteamWebAPI2/Utilities/SteamWebRequestParameterExtensions.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; namespace SteamWebAPI2.Utilities { @@ -43,7 +42,7 @@ internal static void AddIfHasValue(this IList list, /// List of web request parameters that will be used in the building of the request URL internal static void AddIfHasValue(this IList list, string value, string name) { - if (!String.IsNullOrEmpty(value)) + if (!string.IsNullOrEmpty(value)) { list.Add(new SteamWebRequestParameter(name, value)); }