Skip to content

Commit b9c4b67

Browse files
author
Justin
committed
Updated libs.
Comments.
1 parent 54a31d9 commit b9c4b67

8 files changed

Lines changed: 66 additions & 18 deletions

File tree

SteamWebAPI2.Net451/SteamWebAPI2.Net451.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535
<HintPath>..\packages\AutoMapper.4.2.1\lib\net45\AutoMapper.dll</HintPath>
3636
<Private>True</Private>
3737
</Reference>
38-
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
39-
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
38+
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
39+
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
4040
<Private>True</Private>
4141
</Reference>
42-
<Reference Include="Steam.Models, Version=1.0.0.34, Culture=neutral, processorArchitecture=MSIL">
43-
<HintPath>..\packages\Steam.Models.1.0.0.34\lib\net451\Steam.Models.dll</HintPath>
42+
<Reference Include="Steam.Models, Version=1.0.0.37, Culture=neutral, processorArchitecture=MSIL">
43+
<HintPath>..\packages\Steam.Models.1.0.0.37\lib\net451\Steam.Models.dll</HintPath>
4444
<Private>True</Private>
4545
</Reference>
4646
<Reference Include="System" />
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="AutoMapper" version="4.2.1" targetFramework="net451" />
4-
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net451" />
5-
<package id="Steam.Models" version="1.0.0.34" targetFramework="net451" />
4+
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net451" />
5+
<package id="Steam.Models" version="1.0.0.37" targetFramework="net451" />
66
</packages>

SteamWebAPI2.Net452/SteamWebAPI2.Net452.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@
3535
<HintPath>..\packages\AutoMapper.4.2.1\lib\net45\AutoMapper.dll</HintPath>
3636
<Private>True</Private>
3737
</Reference>
38-
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
39-
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
38+
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
39+
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
4040
<Private>True</Private>
4141
</Reference>
42-
<Reference Include="Steam.Models, Version=1.0.0.34, Culture=neutral, processorArchitecture=MSIL">
43-
<HintPath>..\packages\Steam.Models.1.0.0.34\lib\net452\Steam.Models.dll</HintPath>
42+
<Reference Include="Steam.Models, Version=1.0.0.37, Culture=neutral, processorArchitecture=MSIL">
43+
<HintPath>..\packages\Steam.Models.1.0.0.37\lib\net452\Steam.Models.dll</HintPath>
4444
<Private>True</Private>
4545
</Reference>
4646
<Reference Include="System" />
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="AutoMapper" version="4.2.1" targetFramework="net452" />
4-
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net452" />
5-
<package id="Steam.Models" version="1.0.0.34" targetFramework="net452" />
4+
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
5+
<package id="Steam.Models" version="1.0.0.37" targetFramework="net452" />
66
</packages>

SteamWebAPI2/SteamStoreInterface.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,43 @@
77

88
namespace SteamWebAPI2
99
{
10+
/// <summary>
11+
/// Represents an interface into the Steam Store Web API
12+
/// </summary>
1013
public abstract class SteamStoreInterface
1114
{
1215
private const string steamStoreApiBaseUrl = "http://store.steampowered.com/api/";
1316
private readonly SteamStoreRequest steamStoreRequest;
1417
private readonly string endpointName;
1518

19+
/// <summary>
20+
/// Constructs and maps the default objects for Steam Store Web API use
21+
/// </summary>
1622
public SteamStoreInterface()
1723
{
1824
this.steamStoreRequest = new SteamStoreRequest(steamStoreApiBaseUrl);
1925

2026
AutoMapperConfiguration.Initialize();
2127
}
2228

29+
/// <summary>
30+
/// Constructs and maps based on a custom Steam Store Web API URL
31+
/// </summary>
32+
/// <param name="steamStoreApiBaseUrl">Steam Store Web API URL</param>
2333
public SteamStoreInterface(string steamStoreApiBaseUrl)
2434
{
2535
this.steamStoreRequest = new SteamStoreRequest(steamStoreApiBaseUrl);
2636

2737
AutoMapperConfiguration.Initialize();
2838
}
2939

40+
/// <summary>
41+
/// Calls a endpoint on the constructed Web API with parameters
42+
/// </summary>
43+
/// <typeparam name="T">Type of object which will be deserialized from the response</typeparam>
44+
/// <param name="endpointName">Endpoint to call on the interface</param>
45+
/// <param name="parameters">Parameters to pass to the endpoint</param>
46+
/// <returns>Deserialized response object</returns>
3047
internal async Task<T> CallMethodAsync<T>(string endpointName, IList<SteamWebRequestParameter> parameters = null)
3148
{
3249
Debug.Assert(!String.IsNullOrEmpty(endpointName));

SteamWebAPI2/SteamStoreRequest.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,17 @@
99

1010
namespace SteamWebAPI2
1111
{
12+
/// <summary>
13+
/// Represents a request to send to a Steam Store Web API
14+
/// </summary>
1215
internal class SteamStoreRequest
1316
{
1417
private string steamStoreApiBaseUrl;
1518

19+
/// <summary>
20+
/// Constructs a Steam Store Web API request
21+
/// </summary>
22+
/// <param name="steamStoreApiBaseUrl">Steam Store Web API URL</param>
1623
public SteamStoreRequest(string steamStoreApiBaseUrl)
1724
{
1825
if (String.IsNullOrEmpty(steamStoreApiBaseUrl))
@@ -23,13 +30,26 @@ public SteamStoreRequest(string steamStoreApiBaseUrl)
2330
this.steamStoreApiBaseUrl = steamStoreApiBaseUrl;
2431
}
2532

33+
/// <summary>
34+
/// Sends a request to a Steam Store Web API endpoint
35+
/// </summary>
36+
/// <typeparam name="T">Type of object which will be deserialized from the response</typeparam>
37+
/// <param name="endpointName">Endpoint to call on the interface</param>
38+
/// <returns></returns>
2639
public async Task<T> SendStoreRequestAsync<T>(string endpointName)
2740
{
2841
Debug.Assert(!String.IsNullOrEmpty(endpointName));
2942

3043
return await SendStoreRequestAsync<T>(endpointName, null);
3144
}
3245

46+
/// <summary>
47+
/// Sends a request to a Steam Store Web API endpoint with parameters
48+
/// </summary>
49+
/// <typeparam name="T">Type of object which will be deserialized from the response</typeparam>
50+
/// <param name="endpointName">Endpoint to call on the interface</param>
51+
/// <param name="parameters">Parameters to pass to the endpoint</param>
52+
/// <returns>Deserialized response object</returns>
3353
public async Task<T> SendStoreRequestAsync<T>(string endpointName, IList<SteamWebRequestParameter> parameters)
3454
{
3555
Debug.Assert(!String.IsNullOrEmpty(endpointName));
@@ -47,6 +67,11 @@ public async Task<T> SendStoreRequestAsync<T>(string endpointName, IList<SteamWe
4767
return deserializedResult;
4868
}
4969

70+
/// <summary>
71+
/// Returns a string from an HTTP request and removes tabs and newlines
72+
/// </summary>
73+
/// <param name="command">Command (method endpoint) to send to an interface</param>
74+
/// <returns>HTTP response as a string without tabs and newlines</returns>
5075
private static async Task<string> GetHttpStringResponseAsync(string command)
5176
{
5277
HttpClient httpClient = new HttpClient();
@@ -56,6 +81,12 @@ private static async Task<string> GetHttpStringResponseAsync(string command)
5681
return response;
5782
}
5883

84+
/// <summary>
85+
/// Builds a command to send with a request so that parameters and formats are correct
86+
/// </summary>
87+
/// <param name="endpointName">Endpoint to call on the interface</param>
88+
/// <param name="parameters">Parameters to send to the endpoint</param>
89+
/// <returns>Deserialized response object</returns>
5990
public string BuildRequestCommand(string endpointName, IList<SteamWebRequestParameter> parameters)
6091
{
6192
Debug.Assert(!String.IsNullOrEmpty(endpointName));

SteamWebAPI2/SteamWebAPI2.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434
<HintPath>..\packages\AutoMapper.4.2.1\lib\net45\AutoMapper.dll</HintPath>
3535
<Private>True</Private>
3636
</Reference>
37-
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
38-
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
37+
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
38+
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
3939
<Private>True</Private>
4040
</Reference>
41-
<Reference Include="Steam.Models, Version=1.0.0.34, Culture=neutral, processorArchitecture=MSIL">
42-
<HintPath>..\packages\Steam.Models.1.0.0.34\lib\net46\Steam.Models.dll</HintPath>
41+
<Reference Include="Steam.Models, Version=1.0.0.37, Culture=neutral, processorArchitecture=MSIL">
42+
<HintPath>..\packages\Steam.Models.1.0.0.37\lib\net46\Steam.Models.dll</HintPath>
4343
<Private>True</Private>
4444
</Reference>
4545
<Reference Include="System" />

SteamWebAPI2/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
33
<package id="AutoMapper" version="4.2.1" targetFramework="net46" />
4-
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net46" />
5-
<package id="Steam.Models" version="1.0.0.34" targetFramework="net46" />
4+
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net46" />
5+
<package id="Steam.Models" version="1.0.0.37" targetFramework="net46" />
66
</packages>

0 commit comments

Comments
 (0)