added new overloads

This commit is contained in:
aedampir@gmail.com
2016-06-15 15:42:37 +07:00
parent 88d706762b
commit ff0105eb0e
4 changed files with 92 additions and 0 deletions

View File

@@ -21,6 +21,16 @@ namespace Octokit.Reactive
/// <returns>A <see cref="IObservable{Reaction}"/> of <see cref="Reaction"/> representing created reaction for specified comment id.</returns> /// <returns>A <see cref="IObservable{Reaction}"/> of <see cref="Reaction"/> representing created reaction for specified comment id.</returns>
IObservable<Reaction> Create(string owner, string name, int number, NewReaction reaction); IObservable<Reaction> Create(string owner, string name, int number, NewReaction reaction);
/// <summary>
/// Creates a reaction for a specified Commit Comment
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#create-reaction-for-a-commit-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The comment id</param>
/// <param name="reaction">The reaction to create </param>
/// <returns>A <see cref="IObservable{Reaction}"/> of <see cref="Reaction"/> representing created reaction for specified comment id.</returns>
IObservable<Reaction> Create(int repositoryId, int number, NewReaction reaction);
/// <summary> /// <summary>
/// List reactions for a specified Commit Comment /// List reactions for a specified Commit Comment
/// </summary> /// </summary>
@@ -30,5 +40,14 @@ namespace Octokit.Reactive
/// <param name="number">The comment id</param> /// <param name="number">The comment id</param>
/// <returns>A <see cref="IObservable{Reaction}"/> of <see cref="Reaction"/>s representing all reactions for specified comment id.</returns> /// <returns>A <see cref="IObservable{Reaction}"/> of <see cref="Reaction"/>s representing all reactions for specified comment id.</returns>
IObservable<Reaction> GetAll(string owner, string name, int number); IObservable<Reaction> GetAll(string owner, string name, int number);
/// <summary>
/// List reactions for a specified Commit Comment
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment</remarks>
/// <param name="repositoryId">The owner of the repository</param>
/// <param name="number">The comment id</param>
/// <returns>A <see cref="IObservable{Reaction}"/> of <see cref="Reaction"/>s representing all reactions for specified comment id.</returns>
IObservable<Reaction> GetAll(int repositoryId, int number);
} }
} }

View File

@@ -41,6 +41,21 @@ namespace Octokit.Reactive
return _client.Create(owner, name, number, reaction).ToObservable(); return _client.Create(owner, name, number, reaction).ToObservable();
} }
/// <summary>
/// Creates a reaction for a specified Commit Comment
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#create-reaction-for-a-commit-comment</remarks>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="number">The comment id</param>
/// <param name="reaction">The reaction to create </param>
/// <returns>A <see cref="IObservable{Reaction}"/> of <see cref="Reaction"/> representing created reaction for specified comment id.</returns>
public IObservable<Reaction> Create(int repositoryId, int number, NewReaction reaction)
{
Ensure.ArgumentNotNull(reaction, "reaction");
return _client.Create(repositoryId, number, reaction).ToObservable();
}
/// <summary> /// <summary>
/// List reactions for a specified Commit Comment /// List reactions for a specified Commit Comment
/// </summary> /// </summary>
@@ -56,5 +71,17 @@ namespace Octokit.Reactive
return _connection.GetAndFlattenAllPages<Reaction>(ApiUrls.CommitCommentReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview); return _connection.GetAndFlattenAllPages<Reaction>(ApiUrls.CommitCommentReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview);
} }
/// <summary>
/// List reactions for a specified Commit Comment
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment</remarks>
/// <param name="repositoryId">The owner of the repository</param>
/// <param name="number">The comment id</param>
/// <returns>A <see cref="IObservable{Reaction}"/> of <see cref="Reaction"/>s representing all reactions for specified comment id.</returns>
public IObservable<Reaction> GetAll(int repositoryId, int number)
{
return _connection.GetAndFlattenAllPages<Reaction>(ApiUrls.CommitCommentReactions(repositoryId, number), null, AcceptHeaders.ReactionsPreview);
}
} }
} }

View File

@@ -34,6 +34,21 @@ namespace Octokit
return ApiConnection.Post<Reaction>(ApiUrls.CommitCommentReactions(owner, name, number), reaction, AcceptHeaders.ReactionsPreview); return ApiConnection.Post<Reaction>(ApiUrls.CommitCommentReactions(owner, name, number), reaction, AcceptHeaders.ReactionsPreview);
} }
/// <summary>
/// Creates a reaction for a specified Commit Comment
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#create-reaction-for-a-commit-comment</remarks>
/// <param name="repositoryId">The owner of the repository</param>
/// <param name="number">The comment id</param>
/// <param name="reaction">The reaction to create</param>
/// <returns>A <see cref="Reaction"/> representing created reaction for specified comment id.</returns>
public Task<Reaction> Create(int repositoryId, int number, NewReaction reaction)
{
Ensure.ArgumentNotNull(reaction, "reaction");
return ApiConnection.Post<Reaction>(ApiUrls.CommitCommentReactions(repositoryId, number), reaction, AcceptHeaders.ReactionsPreview);
}
/// <summary> /// <summary>
/// Get all reactions for a specified Commit Comment /// Get all reactions for a specified Commit Comment
/// </summary> /// </summary>
@@ -49,5 +64,17 @@ namespace Octokit
return ApiConnection.GetAll<Reaction>(ApiUrls.CommitCommentReactions(owner, name, number), AcceptHeaders.ReactionsPreview); return ApiConnection.GetAll<Reaction>(ApiUrls.CommitCommentReactions(owner, name, number), AcceptHeaders.ReactionsPreview);
} }
/// <summary>
/// Get all reactions for a specified Commit Comment
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment</remarks>
/// <param name="repositoryId">The owner of the repository</param>
/// <param name="number">The comment id</param>
/// <returns>A <see cref="IReadOnlyList{Reaction}"/> of <see cref="Reaction"/>s representing all reactions for specified comment id.</returns>
public Task<IReadOnlyList<Reaction>> GetAll(int repositoryId, int number)
{
return ApiConnection.GetAll<Reaction>(ApiUrls.CommitCommentReactions(repositoryId, number), AcceptHeaders.ReactionsPreview);
}
} }
} }

View File

@@ -22,6 +22,16 @@ namespace Octokit
/// <returns>A <see cref="Reaction"/> representing created reaction for specified comment id.</returns> /// <returns>A <see cref="Reaction"/> representing created reaction for specified comment id.</returns>
Task<Reaction> Create(string owner, string name, int number, NewReaction reaction); Task<Reaction> Create(string owner, string name, int number, NewReaction reaction);
/// <summary>
/// Creates a reaction for a specified Commit Comment
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#create-reaction-for-a-commit-comment</remarks>
/// <param name="repositoryId">The owner of the repository</param>
/// <param name="number">The comment id</param>
/// <param name="reaction">The reaction to create</param>
/// <returns>A <see cref="Reaction"/> representing created reaction for specified comment id.</returns>
Task<Reaction> Create(int repositoryId, int number, NewReaction reaction);
/// <summary> /// <summary>
/// Get all reactions for a specified Commit Comment /// Get all reactions for a specified Commit Comment
/// </summary> /// </summary>
@@ -31,5 +41,14 @@ namespace Octokit
/// <param name="number">The comment id</param> /// <param name="number">The comment id</param>
/// <returns>A <see cref="IReadOnlyList{Reaction}"/> of <see cref="Reaction"/>s representing all reactions for specified comment id.</returns> /// <returns>A <see cref="IReadOnlyList{Reaction}"/> of <see cref="Reaction"/>s representing all reactions for specified comment id.</returns>
Task<IReadOnlyList<Reaction>> GetAll(string owner, string name, int number); Task<IReadOnlyList<Reaction>> GetAll(string owner, string name, int number);
/// <summary>
/// Get all reactions for a specified Commit Comment
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment</remarks>
/// <param name="repositoryId">The owner of the repository</param>
/// <param name="number">The comment id</param>
/// <returns>A <see cref="IReadOnlyList{Reaction}"/> of <see cref="Reaction"/>s representing all reactions for specified comment id.</returns>
Task<IReadOnlyList<Reaction>> GetAll(int repositoryId, int number);
} }
} }