actually implement the thing

This commit is contained in:
Brendan Forster
2014-07-08 11:42:59 +09:30
parent 364f46d444
commit 605500b34f
14 changed files with 62 additions and 3 deletions
@@ -4,6 +4,12 @@ using System.Reactive.Threading.Tasks;
namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's User Keys API.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/users/keys/">User Keys API documentation</a> for more information.
/// </remarks>
public class ObservableUserKeysClient : IObservableUserKeysClient
{
readonly IUserKeysClient _client;
@@ -15,11 +21,25 @@ namespace Octokit.Reactive
_client = client.User.Keys;
}
/// <summary>
/// Gets all public keys for the authenticated user.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/users/keys/#list-your-public-keys
/// </remarks>
/// <returns>The <see cref="PublicKey"/>s for the authenticated user.</returns>
public IObservable<PublicKey> GetAll()
{
return _client.GetAll().ToObservable().SelectMany(k => k);
}
/// <summary>
/// Gets all verified public keys for a user.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/users/keys/#list-public-keys-for-a-user
/// </remarks>
/// <returns>The <see cref="PublicKey"/>s for the user.</returns>
public IObservable<PublicKey> GetAll(string userName)
{
return _client.GetAll(userName).ToObservable().SelectMany(k => k);