mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-01 18:35:35 +00:00
Rename IResponse<T> to IApiResponse
This commit is contained in:
+15
-15
@@ -135,14 +135,14 @@ namespace Octokit
|
||||
_jsonPipeline = new JsonHttpPipeline();
|
||||
}
|
||||
|
||||
public Task<IResponse<T>> Get<T>(Uri uri, IDictionary<string, string> parameters, string accepts)
|
||||
public Task<IApiResponse<T>> Get<T>(Uri uri, IDictionary<string, string> parameters, string accepts)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
|
||||
return SendData<T>(uri.ApplyParameters(parameters), HttpMethod.Get, null, accepts, null, CancellationToken.None);
|
||||
}
|
||||
|
||||
public Task<IResponse<T>> Get<T>(Uri uri, IDictionary<string, string> parameters, string accepts, CancellationToken cancellationToken)
|
||||
public Task<IApiResponse<T>> Get<T>(Uri uri, IDictionary<string, string> parameters, string accepts, CancellationToken cancellationToken)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace Octokit
|
||||
/// <param name="uri">URI endpoint to send request to</param>
|
||||
/// <param name="parameters">Querystring parameters for the request</param>
|
||||
/// <returns><seealso cref="IResponse"/> representing the received HTTP response</returns>
|
||||
public Task<IResponse<string>> GetHtml(Uri uri, IDictionary<string, string> parameters)
|
||||
public Task<IApiResponse<string>> GetHtml(Uri uri, IDictionary<string, string> parameters)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace Octokit
|
||||
});
|
||||
}
|
||||
|
||||
public Task<IResponse<T>> Patch<T>(Uri uri, object body)
|
||||
public Task<IApiResponse<T>> Patch<T>(Uri uri, object body)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
Ensure.ArgumentNotNull(body, "body");
|
||||
@@ -175,7 +175,7 @@ namespace Octokit
|
||||
return SendData<T>(uri, HttpVerb.Patch, body, null, null, CancellationToken.None);
|
||||
}
|
||||
|
||||
public Task<IResponse<T>> Patch<T>(Uri uri, object body, string accepts)
|
||||
public Task<IApiResponse<T>> Patch<T>(Uri uri, object body, string accepts)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
Ensure.ArgumentNotNull(body, "body");
|
||||
@@ -184,7 +184,7 @@ namespace Octokit
|
||||
return SendData<T>(uri, HttpVerb.Patch, body, accepts, null, CancellationToken.None);
|
||||
}
|
||||
|
||||
public Task<IResponse<T>> Post<T>(Uri uri, object body, string accepts, string contentType)
|
||||
public Task<IApiResponse<T>> Post<T>(Uri uri, object body, string accepts, string contentType)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
Ensure.ArgumentNotNull(body, "body");
|
||||
@@ -192,7 +192,7 @@ namespace Octokit
|
||||
return SendData<T>(uri, HttpMethod.Post, body, accepts, contentType, CancellationToken.None);
|
||||
}
|
||||
|
||||
public Task<IResponse<T>> Post<T>(Uri uri, object body, string accepts, string contentType, TimeSpan timeout)
|
||||
public Task<IApiResponse<T>> Post<T>(Uri uri, object body, string accepts, string contentType, TimeSpan timeout)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
Ensure.ArgumentNotNull(body, "body");
|
||||
@@ -200,7 +200,7 @@ namespace Octokit
|
||||
return SendData<T>(uri, HttpMethod.Post, body, accepts, contentType, timeout, CancellationToken.None);
|
||||
}
|
||||
|
||||
public Task<IResponse<T>> Post<T>(Uri uri, object body, string accepts, string contentType, Uri baseAddress)
|
||||
public Task<IApiResponse<T>> Post<T>(Uri uri, object body, string accepts, string contentType, Uri baseAddress)
|
||||
{
|
||||
Ensure.ArgumentNotNull(uri, "uri");
|
||||
Ensure.ArgumentNotNull(body, "body");
|
||||
@@ -208,12 +208,12 @@ namespace Octokit
|
||||
return SendData<T>(uri, HttpMethod.Post, body, accepts, contentType, CancellationToken.None, baseAddress: baseAddress);
|
||||
}
|
||||
|
||||
public Task<IResponse<T>> Put<T>(Uri uri, object body)
|
||||
public Task<IApiResponse<T>> Put<T>(Uri uri, object body)
|
||||
{
|
||||
return SendData<T>(uri, HttpMethod.Put, body, null, null, CancellationToken.None);
|
||||
}
|
||||
|
||||
public Task<IResponse<T>> Put<T>(Uri uri, object body, string twoFactorAuthenticationCode)
|
||||
public Task<IApiResponse<T>> Put<T>(Uri uri, object body, string twoFactorAuthenticationCode)
|
||||
{
|
||||
return SendData<T>(uri,
|
||||
HttpMethod.Put,
|
||||
@@ -224,7 +224,7 @@ namespace Octokit
|
||||
twoFactorAuthenticationCode);
|
||||
}
|
||||
|
||||
Task<IResponse<T>> SendData<T>(
|
||||
Task<IApiResponse<T>> SendData<T>(
|
||||
Uri uri,
|
||||
HttpMethod method,
|
||||
object body,
|
||||
@@ -249,7 +249,7 @@ namespace Octokit
|
||||
return SendDataInternal<T>(body, accepts, contentType, cancellationToken, twoFactorAuthenticationCode, request);
|
||||
}
|
||||
|
||||
Task<IResponse<T>> SendData<T>(
|
||||
Task<IApiResponse<T>> SendData<T>(
|
||||
Uri uri,
|
||||
HttpMethod method,
|
||||
object body,
|
||||
@@ -271,7 +271,7 @@ namespace Octokit
|
||||
return SendDataInternal<T>(body, accepts, contentType, cancellationToken, twoFactorAuthenticationCode, request);
|
||||
}
|
||||
|
||||
Task<IResponse<T>> SendDataInternal<T>(object body, string accepts, string contentType, CancellationToken cancellationToken, string twoFactorAuthenticationCode, Request request)
|
||||
Task<IApiResponse<T>> SendDataInternal<T>(object body, string accepts, string contentType, CancellationToken cancellationToken, string twoFactorAuthenticationCode, Request request)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(accepts))
|
||||
{
|
||||
@@ -412,14 +412,14 @@ namespace Octokit
|
||||
}
|
||||
}
|
||||
|
||||
async Task<IResponse<string>> GetHtml(IRequest request)
|
||||
async Task<IApiResponse<string>> GetHtml(IRequest request)
|
||||
{
|
||||
request.Headers.Add("Accept", "application/vnd.github.html");
|
||||
var response = await RunRequest(request, CancellationToken.None);
|
||||
return new ApiResponse<string>(response, response.Body);
|
||||
}
|
||||
|
||||
async Task<IResponse<T>> Run<T>(IRequest request, CancellationToken cancellationToken)
|
||||
async Task<IApiResponse<T>> Run<T>(IRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
_jsonPipeline.SerializeRequest(request);
|
||||
var response = await RunRequest(request, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user