tidy up some xml-docs while i'm in here

This commit is contained in:
Brendan Forster
2015-11-02 17:48:39 -08:00
parent 50a2b97c17
commit bfb0559351
8 changed files with 64 additions and 7 deletions
+19
View File
@@ -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 -2
View File
@@ -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; }
}
+7
View File
@@ -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();
}
+11
View File
@@ -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);