IApiResponse no longer inherits IResponse

This commit is contained in:
Haacked
2015-01-01 20:37:52 -08:00
parent 09d5c236a4
commit 4c8bab20eb
42 changed files with 383 additions and 397 deletions
+3 -3
View File
@@ -22,7 +22,7 @@ namespace Octokit
/// <summary>
/// Constructs an instance of ApiException
/// </summary>
public ApiException() : this(new ApiResponse<object>())
public ApiException() : this(new Response())
{
}
@@ -32,7 +32,7 @@ namespace Octokit
/// <param name="message">The error message</param>
/// <param name="httpStatusCode">The HTTP status code from the response</param>
public ApiException(string message, HttpStatusCode httpStatusCode)
: this(new ApiResponse<object> {Body = message, StatusCode = httpStatusCode})
: this(new Response {Body = message, StatusCode = httpStatusCode})
{
}
@@ -42,7 +42,7 @@ namespace Octokit
/// <param name="message">The error message</param>
/// <param name="innerException">The inner exception</param>
public ApiException(string message, Exception innerException)
: this(new ApiResponse<object> { Body = message }, innerException)
: this(new Response { Body = message }, innerException)
{
}
+1 -3
View File
@@ -3,7 +3,6 @@ using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Runtime.Serialization;
using Octokit.Internal;
namespace Octokit
{
@@ -20,8 +19,7 @@ namespace Octokit
/// <summary>
/// Constructs an instance of ApiValidationException
/// </summary>
public ApiValidationException()
: base(new ApiResponse<object> { StatusCode = (HttpStatusCode)422 })
public ApiValidationException() : base(new Response { StatusCode = (HttpStatusCode)422})
{
}
+1 -2
View File
@@ -3,7 +3,6 @@ using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Runtime.Serialization;
using Octokit.Internal;
namespace Octokit
{
@@ -20,7 +19,7 @@ namespace Octokit
/// <summary>
/// Constructs an instance of AuthorizationException
/// </summary>
public AuthorizationException() : base(new ApiResponse<object> { StatusCode = HttpStatusCode.Unauthorized })
public AuthorizationException() : base(new Response { StatusCode = HttpStatusCode.Unauthorized })
{
}
@@ -2,7 +2,6 @@
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Runtime.Serialization;
using Octokit.Internal;
namespace Octokit
{
@@ -20,7 +19,7 @@ namespace Octokit
/// Constructs an instance of TwoFactorChallengeFailedException
/// </summary>
public TwoFactorChallengeFailedException() :
base(new ApiResponse<object> { StatusCode = HttpStatusCode.Unauthorized })
base(new Response { StatusCode = HttpStatusCode.Unauthorized })
{
}
@@ -29,7 +28,7 @@ namespace Octokit
/// </summary>
/// <param name="innerException">The inner exception</param>
public TwoFactorChallengeFailedException(Exception innerException)
: base(new ApiResponse<object> { StatusCode = HttpStatusCode.Unauthorized }, innerException)
: base(new Response { StatusCode = HttpStatusCode.Unauthorized }, innerException)
{
}
@@ -29,7 +29,7 @@ namespace Octokit
/// </summary>
/// <param name="twoFactorType">Expected 2FA response type</param>
public TwoFactorRequiredException(TwoFactorType twoFactorType)
: this(new ApiResponse<object> { StatusCode = HttpStatusCode.Unauthorized}, twoFactorType)
: this(new Response { StatusCode = HttpStatusCode.Unauthorized}, twoFactorType)
{
}