Add pagination support (ApiOptions overloads) to UserKeys client. (#1278)

This commit is contained in:
Devesh Khandelwal
2016-04-29 09:47:24 +05:30
committed by Brendan Forster
parent 63a8c1d70a
commit e35f237214
6 changed files with 160 additions and 43 deletions
@@ -13,14 +13,14 @@ namespace Octokit.Reactive
public interface IObservableUserKeysClient
{
/// <summary>
/// Gets all public keys for the authenticated user.
/// Gets all verified public keys for a user.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/users/keys/#list-your-public-keys
/// https://developer.github.com/v3/users/keys/#list-public-keys-for-a-user
/// </remarks>
/// <returns></returns>
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
IObservable<PublicKey> GetAllForCurrent();
/// <param name="userName">The @ handle of the user.</param>
/// <returns>Lists the verified public keys for a user.</returns>
IObservable<PublicKey> GetAll(string userName);
/// <summary>
/// Gets all verified public keys for a user.
@@ -28,8 +28,31 @@ namespace Octokit.Reactive
/// <remarks>
/// https://developer.github.com/v3/users/keys/#list-public-keys-for-a-user
/// </remarks>
/// <returns></returns>
IObservable<PublicKey> GetAll(string userName);
/// <param name="userName">The @ handle of the user.</param>
/// <param name="options">Options to change API's behavior.</param>
/// <returns>Lists the verified public keys for a user.</returns>
IObservable<PublicKey> GetAll(string userName, ApiOptions options);
/// <summary>
/// Gets all public keys for the authenticated user.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/users/keys/#list-your-public-keys
/// </remarks>
/// <returns>Lists the current user's keys.</returns>
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
IObservable<PublicKey> GetAllForCurrent();
/// <summary>
/// Gets all public keys for the authenticated user.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/users/keys/#list-your-public-keys
/// </remarks>
/// <param name="options">Options to change API's behavior.</param>
/// <returns>Lists the current user's keys.</returns>
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
IObservable<PublicKey> GetAllForCurrent(ApiOptions options);
/// <summary>
/// Retrieves the <see cref="PublicKey"/> for the specified id.
@@ -38,7 +61,7 @@ namespace Octokit.Reactive
/// 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>
/// <returns>View extended details for a single public key.</returns>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
IObservable<PublicKey> Get(int id);
@@ -49,7 +72,7 @@ namespace Octokit.Reactive
/// https://developer.github.com/v3/users/keys/#create-a-public-key
/// </remarks>
/// <param name="newKey">The SSH Key contents</param>
/// <returns></returns>
/// <returns>Creates a public key.</returns>
IObservable<PublicKey> Create(NewPublicKey newKey);
/// <summary>
@@ -59,7 +82,7 @@ namespace Octokit.Reactive
/// 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>
/// <returns>Removes a public key.</returns>
IObservable<Unit> Delete(int id);
}
}