Skip to content

Commit db48211

Browse files
author
Justin Skiles
authored
Merge pull request #73 from babelshift/chore/refactor-http-client
Refactored to allow injecting custom HttpClient. Also some cleanup.
2 parents 400843c + 75466d8 commit db48211

28 files changed

Lines changed: 145 additions & 108 deletions

src/SteamWebAPI2/AutoMapperConfiguration.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
using SteamWebAPI2.Utilities;
2121
using System;
2222
using System.Collections.Generic;
23-
using System.Collections.ObjectModel;
2423
using System.Linq;
2524

2625
namespace SteamWebAPI2
@@ -88,7 +87,6 @@ public static void Initialize()
8887
CreateSteamWebResponseMap<MatchHistoryBySequenceNumberResultContainer, IReadOnlyCollection<MatchHistoryMatchModel>>(x);
8988
CreateSteamWebResponseMap<TeamInfoResultContainer, IReadOnlyCollection<TeamInfoModel>>(x);
9089
CreateSteamWebResponseMap<EconItemResultContainer, EconItemResultModel>(x);
91-
//CreateSteamWebResponseMap<SchemaResultContainer, Steam.Models.DOTA2.SchemaModel>(x);
9290
CreateSteamWebResponseMap<SchemaResultContainer, Steam.Models.TF2.SchemaModel>(x);
9391
CreateSteamWebResponseMap<SchemaUrlResultContainer, string>(x);
9492
CreateSteamWebResponseMap<StoreMetaDataResultContainer, StoreMetaDataModel>(x);

src/SteamWebAPI2/Interfaces/CSGOServers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ public class CSGOServers : ICSGOServers
1616
/// Default constructor established the Steam Web API key and initializes for subsequent method calls
1717
/// </summary>
1818
/// <param name="steamWebApiKey"></param>
19-
public CSGOServers(string steamWebApiKey, ISteamWebInterface steamWebInterface = null)
19+
public CSGOServers(ISteamWebRequest steamWebRequest, ISteamWebInterface steamWebInterface = null)
2020
{
2121
this.steamWebInterface = steamWebInterface == null
22-
? new SteamWebInterface(steamWebApiKey, "ICSGOServers_730")
22+
? new SteamWebInterface("ICSGOServers_730", steamWebRequest)
2323
: steamWebInterface;
2424
}
2525

src/SteamWebAPI2/Interfaces/DOTA2Econ.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ public class DOTA2Econ : IDOTA2Econ
1919
/// Default constructor established the Steam Web API key and initializes for subsequent method calls
2020
/// </summary>
2121
/// <param name="steamWebApiKey"></param>
22-
public DOTA2Econ(string steamWebApiKey, ISteamWebInterface steamWebInterface = null)
22+
public DOTA2Econ(ISteamWebRequest steamWebRequest, ISteamWebInterface steamWebInterface = null)
2323
{
2424
this.steamWebInterface = steamWebInterface == null
25-
? new SteamWebInterface(steamWebApiKey, "IEconDOTA2_570")
25+
? new SteamWebInterface("IEconDOTA2_570", steamWebRequest)
2626
: steamWebInterface;
2727
}
2828

src/SteamWebAPI2/Interfaces/DOTA2Fantasy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ public class DOTA2Fantasy : IDOTA2Fantasy
1414
/// Default constructor established the Steam Web API key and initializes for subsequent method calls
1515
/// </summary>
1616
/// <param name="steamWebApiKey"></param>
17-
public DOTA2Fantasy(string steamWebApiKey, ISteamWebInterface steamWebInterface = null)
17+
public DOTA2Fantasy(ISteamWebRequest steamWebRequest, ISteamWebInterface steamWebInterface = null)
1818
{
1919
this.steamWebInterface = steamWebInterface == null
20-
? new SteamWebInterface(steamWebApiKey, "IDOTA2Fantasy_570")
20+
? new SteamWebInterface("IDOTA2Fantasy_570", steamWebRequest)
2121
: steamWebInterface;
2222
}
2323

src/SteamWebAPI2/Interfaces/DOTA2Match.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ public class DOTA2Match : IDOTA2Match
1616
/// Default constructor established the Steam Web API key and initializes for subsequent method calls
1717
/// </summary>
1818
/// <param name="steamWebApiKey"></param>
19-
public DOTA2Match(string steamWebApiKey, ISteamWebInterface steamWebInterface = null)
19+
public DOTA2Match(ISteamWebRequest steamWebRequest, ISteamWebInterface steamWebInterface = null)
2020
{
2121
this.steamWebInterface = steamWebInterface == null
22-
? new SteamWebInterface(steamWebApiKey, "IDOTA2Match_570")
22+
? new SteamWebInterface("IDOTA2Match_570", steamWebRequest)
2323
: steamWebInterface;
2424
}
2525

src/SteamWebAPI2/Interfaces/DOTA2Ticket.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ public class DOTA2Ticket : IDOTA2Ticket
99
/// <summary>
1010
/// Default constructor established the Steam Web API key and initializes for subsequent method calls
1111
/// </summary>
12-
/// <param name="steamWebApiKey"></param>
13-
public DOTA2Ticket(string steamWebApiKey, ISteamWebInterface steamWebInterface = null)
12+
/// <param name="steamWebRequest"></param>
13+
public DOTA2Ticket(ISteamWebRequest steamWebRequest, ISteamWebInterface steamWebInterface = null)
1414
{
1515
this.steamWebInterface = steamWebInterface == null
16-
? new SteamWebInterface(steamWebApiKey, "IDOTA2Ticket_570")
16+
? new SteamWebInterface("IDOTA2Ticket_570", steamWebRequest)
1717
: steamWebInterface;
1818
}
1919
}

src/SteamWebAPI2/Interfaces/EconItems.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ public class EconItems : IEconItems
3636
/// <summary>
3737
/// Default constructor established the Steam Web API key and initializes for subsequent method calls
3838
/// </summary>
39-
/// <param name="steamWebApiKey"></param>
40-
public EconItems(string steamWebApiKey, EconItemsAppId appId, ISteamWebInterface steamWebInterface = null)
39+
/// <param name="steamWebRequest"></param>
40+
public EconItems(ISteamWebRequest steamWebRequest, EconItemsAppId appId, ISteamWebInterface steamWebInterface = null)
4141
{
4242
if (appId <= 0)
4343
{
4444
throw new ArgumentOutOfRangeException("appId");
4545
}
4646

4747
this.steamWebInterface = steamWebInterface == null
48-
? new SteamWebInterface(steamWebApiKey, "IEconItems_" + (uint)appId)
48+
? new SteamWebInterface("IEconItems_" + (uint)appId, steamWebRequest)
4949
: steamWebInterface;
5050

5151
this.appId = (uint)appId;

src/SteamWebAPI2/Interfaces/EconService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ public class EconService : IEconService
1212
/// <summary>
1313
/// Default constructor established the Steam Web API key and initializes for subsequent method calls
1414
/// </summary>
15-
/// <param name="steamWebApiKey"></param>
16-
public EconService(string steamWebApiKey, ISteamWebInterface steamWebInterface = null)
15+
/// <param name="steamWebRequest"></param>
16+
public EconService(ISteamWebRequest steamWebRequest, ISteamWebInterface steamWebInterface = null)
1717
{
1818
this.steamWebInterface = steamWebInterface == null
19-
? new SteamWebInterface(steamWebApiKey, "IEconService")
19+
? new SteamWebInterface("IEconService", steamWebRequest)
2020
: steamWebInterface;
2121
}
2222

src/SteamWebAPI2/Interfaces/GCVersion.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ public class GCVersion : IGCVersion
2929
/// <summary>
3030
/// Default constructor established the Steam Web API key and initializes for subsequent method calls
3131
/// </summary>
32-
/// <param name="steamWebApiKey"></param>
33-
public GCVersion(string steamWebApiKey, GCVersionAppId appId, ISteamWebInterface steamWebInterface = null)
32+
/// <param name="steamWebRequest"></param>
33+
public GCVersion(ISteamWebRequest steamWebRequest, GCVersionAppId appId, ISteamWebInterface steamWebInterface = null)
3434
{
3535
this.steamWebInterface = steamWebInterface == null
36-
? new SteamWebInterface(steamWebApiKey, "IGCVersion_" + (uint)appId)
36+
? new SteamWebInterface("IGCVersion_" + (uint)appId, steamWebRequest)
3737
: steamWebInterface;
3838

3939
if (appId <= 0)

src/SteamWebAPI2/Interfaces/GameServersService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ public class GameServersService : IGameServersService
1111
/// <summary>
1212
/// Default constructor established the Steam Web API key and initializes for subsequent method calls
1313
/// </summary>
14-
/// <param name="steamWebApiKey"></param>
15-
public GameServersService(string steamWebApiKey, ISteamWebInterface steamWebInterface = null)
14+
/// <param name="steamWebRequest"></param>
15+
public GameServersService(ISteamWebRequest steamWebRequest, ISteamWebInterface steamWebInterface = null)
1616
{
1717
this.steamWebInterface = steamWebInterface == null
18-
? new SteamWebInterface(steamWebApiKey, "IGameServersService")
18+
? new SteamWebInterface("IGameServersService", steamWebRequest)
1919
: steamWebInterface;
2020
}
2121

0 commit comments

Comments
 (0)