Skip to content

Commit 0921945

Browse files
committed
Replaced Skybrud.Social.Core dependency with Skybrud.Essentials.Http
1 parent fbf14e5 commit 0921945

File tree

7 files changed

+34
-34
lines changed

7 files changed

+34
-34
lines changed

src/Skybrud.Social.TwentyThree/Endpoints/Raw/TwentyThreePhotosRawEndpoint.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using System;
2-
using Skybrud.Social.Http;
2+
using Skybrud.Essentials.Http;
33
using Skybrud.Social.TwentyThree.OAuth;
44
using Skybrud.Social.TwentyThree.Options.Photos;
55

@@ -32,24 +32,24 @@ internal TwentyThreePhotosRawEndpoint(TwentyThreeOAuthClient client) {
3232
/// <summary>
3333
/// Returns a list of photos or videos.
3434
/// </summary>
35-
/// <returns>An instance of <see cref="SocialHttpResponse"/> representing the raw response.</returns>
35+
/// <returns>An instance of <see cref="IHttpResponse"/> representing the raw response.</returns>
3636
/// <see>
3737
/// <cref>https://www.twentythree.net/api/photo-list</cref>
3838
/// </see>
39-
public SocialHttpResponse GetList() {
40-
return Client.DoHttpGetRequest("/api/photo/list");
39+
public IHttpResponse GetList() {
40+
return Client.Get("/api/photo/list");
4141
}
4242

4343
/// <summary>
4444
/// Returns a list of photos or videos.
4545
/// </summary>
46-
/// <returns>An instance of <see cref="SocialHttpResponse"/> representing the raw response.</returns>
46+
/// <returns>An instance of <see cref="IHttpResponse"/> representing the raw response.</returns>
4747
/// <see>
4848
/// <cref>https://www.twentythree.net/api/photo-list</cref>
4949
/// </see>
50-
public SocialHttpResponse GetList(TwentyThreeGetPhotosOptions options) {
50+
public IHttpResponse GetList(TwentyThreeGetPhotosOptions options) {
5151
if (options == null) throw new ArgumentNullException(nameof(options));
52-
return Client.DoHttpGetRequest("/api/photo/list", options);
52+
return Client.Get("/api/photo/list", options);
5353
}
5454

5555
#endregion

src/Skybrud.Social.TwentyThree/Exceptions/TwentyThreeHttpException.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22
using System.Net;
3-
using Skybrud.Social.Http;
3+
using Skybrud.Essentials.Http;
44
using Skybrud.Social.TwentyThree.Models;
55

66
namespace Skybrud.Social.TwentyThree.Exceptions {
@@ -10,9 +10,9 @@ public class TwentyThreeHttpException : Exception {
1010
#region Properties
1111

1212
/// <summary>
13-
/// Gets a reference to the underlying <see cref="SocialHttpResponse"/>.
13+
/// Gets a reference to the underlying <see cref="IHttpResponse"/>.
1414
/// </summary>
15-
public SocialHttpResponse Response { get; }
15+
public IHttpResponse Response { get; }
1616

1717
/// <summary>
1818
/// Gets the HTTP status code returned by the Twenty Three API.
@@ -27,7 +27,7 @@ public class TwentyThreeHttpException : Exception {
2727

2828
#region Constructors
2929

30-
public TwentyThreeHttpException(SocialHttpResponse response, TwentyThreeError error) : base("Invalid response received from the Twenty Three API (Status: " + ((int) response.StatusCode) + ")") {
30+
public TwentyThreeHttpException(IHttpResponse response, TwentyThreeError error) : base("Invalid response received from the Twenty Three API (Status: " + ((int) response.StatusCode) + ")") {
3131
Response = response;
3232
StatusCode = response.StatusCode;
3333
Error = error;

src/Skybrud.Social.TwentyThree/OAuth/TwentyThreeOAuthClient.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
using System;
22
using Skybrud.Essentials.Common;
3-
using Skybrud.Social.Http;
4-
using Skybrud.Social.OAuth;
3+
using Skybrud.Essentials.Http;
4+
using Skybrud.Essentials.Http.Collections;
5+
using Skybrud.Essentials.Http.OAuth;
56
using Skybrud.Social.TwentyThree.Endpoints.Raw;
67

78
namespace Skybrud.Social.TwentyThree.OAuth {
89

9-
public class TwentyThreeOAuthClient : SocialOAuthClient {
10+
public class TwentyThreeOAuthClient : OAuthClient {
1011

1112
#region Properties
1213

@@ -60,18 +61,18 @@ public TwentyThreeOAuthClient(string consumerKey, string consumerSecret, string
6061

6162
#region Member methods
6263

63-
protected override void PrepareHttpRequest(SocialHttpRequest request) {
64+
protected override void PrepareHttpRequest(IHttpRequest request) {
6465

6566
// Should we append the domain and schema to the URL?
6667
if (request.Url.StartsWith("/api/")) {
67-
if (String.IsNullOrWhiteSpace(HostName)) throw new PropertyNotSetException(nameof(HostName));
68+
if (string.IsNullOrWhiteSpace(HostName)) throw new PropertyNotSetException(nameof(HostName));
6869
request.Url = "https://" + HostName + request.Url;
6970
}
7071

7172
// Append "raw" to the query string so we can get a proper JSON response
72-
if (request.QueryString == null) request.QueryString = new SocialHttpQueryString();
73+
if (request.QueryString == null) request.QueryString = new HttpQueryString();
7374
request.QueryString.Add("format", "json");
74-
request.QueryString.Add("raw", String.Empty);
75+
request.QueryString.Add("raw", string.Empty);
7576

7677
// Call the base method to handle OAuth 1.0a logic
7778
base.PrepareHttpRequest(request);

src/Skybrud.Social.TwentyThree/Options/Photos/TwentyThreeGetPhotosOptions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Skybrud.Social.Http;
2-
using Skybrud.Social.Interfaces.Http;
1+
using Skybrud.Essentials.Http.Collections;
2+
using Skybrud.Essentials.Http.Options;
33

44
namespace Skybrud.Social.TwentyThree.Options.Photos {
55

@@ -41,7 +41,7 @@ public class TwentyThreeGetPhotosOptions : IHttpGetOptions {
4141

4242
public IHttpQueryString GetQueryString() {
4343

44-
IHttpQueryString query = new SocialHttpQueryString();
44+
IHttpQueryString query = new HttpQueryString();
4545

4646
if (string.IsNullOrWhiteSpace(PhotoId) == false) query.Add("photo_id", PhotoId);
4747
if (string.IsNullOrWhiteSpace(Token) == false) query.Add("token", Token);

src/Skybrud.Social.TwentyThree/Responses/Photos/TwentyThreeGetPhotosResponse.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22
using Newtonsoft.Json.Linq;
3-
using Skybrud.Social.Http;
3+
using Skybrud.Essentials.Http;
44
using Skybrud.Social.TwentyThree.Models.Photos;
55

66
namespace Skybrud.Social.TwentyThree.Responses.Photos {
@@ -12,7 +12,7 @@ public class TwentyThreeGetPhotosResponse : TwentyThreeResponse<TwentyThreePhoto
1212

1313
#region Constructors
1414

15-
private TwentyThreeGetPhotosResponse(SocialHttpResponse response) : base(response) {
15+
private TwentyThreeGetPhotosResponse(IHttpResponse response) : base(response) {
1616

1717
// Validate the response
1818
ValidateResponse(response, out JObject body);
@@ -31,7 +31,7 @@ private TwentyThreeGetPhotosResponse(SocialHttpResponse response) : base(respons
3131
/// </summary>
3232
/// <param name="response">The response to be parsed.</param>
3333
/// <returns>An instance of <see cref="TwentyThreeGetPhotosResponse"/> representing the response.</returns>
34-
public static TwentyThreeGetPhotosResponse ParseResponse(SocialHttpResponse response) {
34+
public static TwentyThreeGetPhotosResponse ParseResponse(IHttpResponse response) {
3535
if (response == null) throw new ArgumentNullException(nameof(response));
3636
return new TwentyThreeGetPhotosResponse(response);
3737
}

src/Skybrud.Social.TwentyThree/Responses/TwentyThreeResponse.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
using System.Net;
2-
using Newtonsoft.Json.Linq;
1+
using Newtonsoft.Json.Linq;
2+
using Skybrud.Essentials.Http;
33
using Skybrud.Essentials.Json;
44
using Skybrud.Essentials.Json.Extensions;
5-
using Skybrud.Social.Http;
65
using Skybrud.Social.TwentyThree.Exceptions;
76
using Skybrud.Social.TwentyThree.Models;
87

@@ -11,15 +10,15 @@ namespace Skybrud.Social.TwentyThree.Responses {
1110
/// <summary>
1211
/// Class representing a response from the Twenty Three API.
1312
/// </summary>
14-
public class TwentyThreeResponse : SocialResponse {
13+
public class TwentyThreeResponse : HttpResponseBase {
1514

1615
#region Constructors
1716

1817
/// <summary>
1918
/// Initializes a new instance based on the specified <paramref name="response"/>.
2019
/// </summary>
21-
/// <param name="response">The instance of <see cref="SocialHttpResponse"/> representing the raw response.</param>
22-
protected TwentyThreeResponse(SocialHttpResponse response) : base(response) { }
20+
/// <param name="response">The instance of <see cref="IHttpResponse"/> representing the raw response.</param>
21+
protected TwentyThreeResponse(IHttpResponse response) : base(response) { }
2322

2423
#endregion
2524

@@ -30,7 +29,7 @@ protected TwentyThreeResponse(SocialHttpResponse response) : base(response) { }
3029
/// </summary>
3130
/// <param name="response">The response to be validated.</param>
3231
/// <param name="body">An instacne of <see cref="JObject"/> representing the response body.</param>
33-
public static void ValidateResponse(SocialHttpResponse response, out JObject body) {
32+
public static void ValidateResponse(IHttpResponse response, out JObject body) {
3433

3534
// The API always returns a 200 status code - even for errors
3635

@@ -67,8 +66,8 @@ public class TwentyThreeResponse<T> : TwentyThreeResponse {
6766
/// <summary>
6867
/// Initializes a new instance based on the specified <paramref name="response"/>.
6968
/// </summary>
70-
/// <param name="response">The instance of <see cref="SocialHttpResponse"/> representing the raw response.</param>
71-
protected TwentyThreeResponse(SocialHttpResponse response) : base(response) { }
69+
/// <param name="response">The instance of <see cref="IHttpResponse"/> representing the raw response.</param>
70+
protected TwentyThreeResponse(IHttpResponse response) : base(response) { }
7271

7372
#endregion
7473

src/Skybrud.Social.TwentyThree/Skybrud.Social.TwentyThree.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</PropertyGroup>
3838

3939
<ItemGroup>
40-
<PackageReference Include="Skybrud.Social.Core" Version="1.0.10" />
40+
<PackageReference Include="Skybrud.Essentials.Http" Version="1.0.7" />
4141
</ItemGroup>
4242

4343
<!--

0 commit comments

Comments
 (0)