mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-05 03:30:34 +00:00
tidy up some xml-docs while i'm in here
This commit is contained in:
@@ -1,11 +1,24 @@
|
||||
namespace Octokit.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Wrapper for a response from the API
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Payload contained in the response</typeparam>
|
||||
public class ApiResponse<T> : IApiResponse<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Create a ApiResponse from an existing request
|
||||
/// </summary>
|
||||
/// <param name="response">An existing request to wrap</param>
|
||||
public ApiResponse(IResponse response) : this(response, GetBodyAsObject(response))
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a ApiResponse from an existing request and object
|
||||
/// </summary>
|
||||
/// <param name="response">An existing request to wrap</param>
|
||||
/// <param name="bodyAsObject">The payload from an existing request</param>
|
||||
public ApiResponse(IResponse response, T bodyAsObject)
|
||||
{
|
||||
Ensure.ArgumentNotNull(response, "response");
|
||||
@@ -14,8 +27,14 @@
|
||||
Body = bodyAsObject;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The payload of the response
|
||||
/// </summary>
|
||||
public T Body { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The context of the response
|
||||
/// </summary>
|
||||
public IResponse HttpResponse { get; private set; }
|
||||
|
||||
static T GetBodyAsObject(IResponse response)
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
namespace Octokit.Internal
|
||||
{
|
||||
public static class HttpVerb
|
||||
internal static class HttpVerb
|
||||
{
|
||||
static readonly HttpMethod patch = new HttpMethod("PATCH");
|
||||
|
||||
public static HttpMethod Patch
|
||||
internal static HttpMethod Patch
|
||||
{
|
||||
get { return patch; }
|
||||
}
|
||||
|
||||
@@ -3,8 +3,15 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
/// <summary>
|
||||
/// Abstraction for interacting with credentials
|
||||
/// </summary>
|
||||
public interface ICredentialStore
|
||||
{
|
||||
/// <summary>
|
||||
/// Retrieve the credentials from the underlying store
|
||||
/// </summary>
|
||||
/// <returns>A continuation containing credentials</returns>
|
||||
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification="Nope")]
|
||||
Task<Credentials> GetCredentials();
|
||||
}
|
||||
|
||||
@@ -2,10 +2,17 @@
|
||||
|
||||
namespace Octokit.Internal
|
||||
{
|
||||
/// <summary>
|
||||
/// Abstraction for interacting with credentials
|
||||
/// </summary>
|
||||
public class InMemoryCredentialStore : ICredentialStore
|
||||
{
|
||||
readonly Credentials _credentials;
|
||||
|
||||
/// <summary>
|
||||
/// Create an instance of the InMemoryCredentialStore
|
||||
/// </summary>
|
||||
/// <param name="credentials"></param>
|
||||
public InMemoryCredentialStore(Credentials credentials)
|
||||
{
|
||||
Ensure.ArgumentNotNull(credentials, "credentials");
|
||||
@@ -13,6 +20,10 @@ namespace Octokit.Internal
|
||||
_credentials = credentials;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve the credentials from the underlying store
|
||||
/// </summary>
|
||||
/// <returns>A continuation containing credentials</returns>
|
||||
public Task<Credentials> GetCredentials()
|
||||
{
|
||||
return Task.FromResult(_credentials);
|
||||
|
||||
Reference in New Issue
Block a user