Files
octokit.net/Octokit.Reactive/Clients/IObservableUserKeysClient.cs
2016-02-23 06:58:09 +10:00

65 lines
2.2 KiB
C#

using System;
using System.Diagnostics.CodeAnalysis;
using System.Reactive;
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 interface IObservableUserKeysClient
{
/// <summary>
/// Gets all public keys for the authenticated user.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/users/keys/#list-your-public-keys
/// </remarks>
/// <returns></returns>
IObservable<PublicKey> GetAll();
/// <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></returns>
IObservable<PublicKey> GetAll(string userName);
/// <summary>
/// Retrieves the <see cref="PublicKey"/> for the specified id.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/users/keys/#get-a-single-public-key
/// </remarks>
/// <param name="id">The ID of the SSH key</param>
/// <returns></returns>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
IObservable<PublicKey> Get(int id);
/// <summary>
/// Create a public key <see cref="NewPublicKey"/>.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/users/keys/#create-a-public-key
/// </remarks>
/// <param name="newKey">The SSH Key contents</param>
/// <returns></returns>
IObservable<PublicKey> Create(NewPublicKey newKey);
/// <summary>
/// Delete a public key.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/users/keys/#delete-a-public-key
/// </remarks>
/// <param name="id">The id of the key to delete</param>
/// <returns></returns>
IObservable<Unit> Delete(int id);
}
}