tidying up some of the helper types

This commit is contained in:
Brendan Forster
2014-12-21 16:47:30 +09:30
committed by Haacked
parent 3be89e7c01
commit 061e5981a7
5 changed files with 30 additions and 4 deletions
+7
View File
@@ -6,11 +6,18 @@ namespace Octokit
{
static readonly Uri _currentUserKeysUrl = new Uri("user/keys", UriKind.Relative);
/// <summary>
/// Returns the <see cref="Uri"/> to retrieve keys for the current user.
/// </summary>
public static Uri Keys()
{
return _currentUserKeysUrl;
}
/// <summary>
/// Returns the <see cref="Uri"/> to retrieve keys for a given user.
/// </summary>
/// <param name="userName">The user to search on</param>
public static Uri Keys(string userName)
{
return "users/{0}/keys".FormatUri(userName);
+19 -1
View File
@@ -681,7 +681,7 @@ namespace Octokit
}
/// <summary>
/// Returns the <see cref="Uri"/> for the specified commit.
/// Returns the <see cref="Uri"/> for the specified gist.
/// </summary>
/// <param name="id">The id of the gist</param>
public static Uri Gist(string id)
@@ -689,26 +689,44 @@ namespace Octokit
return "gists/{0}".FormatUri(id);
}
/// <summary>
/// Returns the <see cref="Uri"/> for the forks of a given gist.
/// </summary>
/// <param name="id">The id of the gist</param>
public static Uri ForkGist(string id)
{
return "gists/{0}/forks".FormatUri(id);
}
/// <summary>
/// Returns the <see cref="Uri"/> for all public gists.
/// </summary>
public static Uri PublicGists()
{
return "gists/public".FormatUri();
}
/// <summary>
/// Returns the <see cref="Uri"/> for all started public gists.
/// </summary>
public static Uri StarredGists()
{
return "gists/starred".FormatUri();
}
/// <summary>
/// Returns the <see cref="Uri"/> for all gists for a given user.
/// </summary>
/// <param name="user">The user to search for</param>
public static Uri UsersGists(string user)
{
return "users/{0}/gists".FormatUri(user);
}
/// <summary>
/// Returns the <see cref="Uri"/> to star a given gist.
/// </summary>
/// <param name="id">The id of the gist</param>
public static Uri StarGist(string id)
{
return "gists/{0}/star".FormatUri(id);
-1
View File
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Linq;
namespace Octokit
{
+1 -1
View File
@@ -9,7 +9,7 @@ namespace Octokit
static class EnumExtensions
{
[SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase")]
public static string ToParameter(this Enum prop)
internal static string ToParameter(this Enum prop)
{
if (prop == null) return null;
+3 -1
View File
@@ -1,4 +1,5 @@
using System.Threading;
using System;
using System.Threading;
using System.Threading.Tasks;
using Octokit.Internal;
@@ -6,6 +7,7 @@ namespace Octokit
{
public static class HttpClientExtensions
{
[Obsolete("This will be removed in a future release")]
public static Task<IResponse<T>> Send<T>(this IHttpClient httpClient, IRequest request)
{
Ensure.ArgumentNotNull(httpClient, "httpClient");