Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stand alone reaction client #1335

Merged
merged 78 commits into from
Jun 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
7c99350
add new method for reaction in RepositoryCommentsClient.cs
martinscholz83 May 25, 2016
3d39207
add request and response for commit comment reactions
martinscholz83 May 25, 2016
d90bfdb
add accept headers for reactions
martinscholz83 May 25, 2016
9f98916
add reaction for observable repository comment client
martinscholz83 May 25, 2016
7c894cd
add unit test for commit comment reaction
martinscholz83 May 25, 2016
93ab528
add unit test for observable repository comment reaction
martinscholz83 May 25, 2016
b98a9e9
Merge remote-tracking branch 'refs/remotes/octokit/master' into react…
martinscholz83 May 25, 2016
b30fade
add integration test for repository comment reaction
martinscholz83 May 25, 2016
1e7fa47
fix .csproj files
martinscholz83 May 25, 2016
1a2396b
add apiurl for commit comment reaction
martinscholz83 May 25, 2016
963b979
change content of newCommitCommentReaction
martinscholz83 May 25, 2016
aac9d69
hardcoded accept header in repository comments client test
martinscholz83 May 25, 2016
180b766
Merge remote-tracking branch 'refs/remotes/octokit/master' into react…
martinscholz83 May 26, 2016
29b6fd3
fix some suggestions
martinscholz83 May 26, 2016
ad419b3
change parameter values for reactions
martinscholz83 May 26, 2016
9139562
change reaction enum
martinscholz83 May 26, 2016
14bbf8c
compare reaction respone fields
martinscholz83 May 27, 2016
69afe63
change response and request clients for reactions
martinscholz83 May 27, 2016
3d18af4
Merge remote-tracking branch 'refs/remotes/origin/reactions' into iss…
martinscholz83 May 27, 2016
9f22e17
change class name for enum reactions
martinscholz83 May 27, 2016
06fdace
create classes for standalone reaction client and CommitCommentReaction
martinscholz83 May 27, 2016
6bedcf8
add GetAll Method for uri and accepts
martinscholz83 May 27, 2016
6baaa4e
Merge remote-tracking branch 'refs/remotes/octokit/master' into stand…
martinscholz83 May 29, 2016
831ff1c
Add observable reactions client
martinscholz83 May 29, 2016
f983bba
add observable Reactions and CommitCommentReaction client
martinscholz83 May 30, 2016
6fef1ce
add unit tests for reactions
martinscholz83 May 30, 2016
c536b85
Check null for newReaction
martinscholz83 May 30, 2016
10fe3cd
create unit tests for CommitCommentReactionClient
martinscholz83 May 30, 2016
18946fb
add IssuesReactionsClient; some fixes
martinscholz83 May 31, 2016
c9fdb45
set singular on reaction clients
martinscholz83 Jun 1, 2016
53f61cd
fix method names for reaction clients
martinscholz83 Jun 1, 2016
17e6137
add api url for IssueCommentReaction
martinscholz83 Jun 1, 2016
eddf602
add IssueCommentReactionsClient
martinscholz83 Jun 1, 2016
b5a831c
extend GetAll Methods for AccepHeaders
martinscholz83 Jun 1, 2016
cd40b03
new unit tests for reaction clients
martinscholz83 Jun 1, 2016
191451a
add api url for PullRequestReviewComment
martinscholz83 Jun 1, 2016
dc59d58
add IssueComment for Reactions Client
martinscholz83 Jun 1, 2016
2611af5
fix broken links for reaction clients
martinscholz83 Jun 1, 2016
3a4031f
add PullRequestReviewCommentReactionClient
martinscholz83 Jun 1, 2016
7e4b42b
add unit tests for reaction clients
martinscholz83 Jun 1, 2016
28f454a
add descriptions for observable reactions client
martinscholz83 Jun 1, 2016
c4c374c
add delete method for reaction client
martinscholz83 Jun 1, 2016
2ebe0ee
add unit test for reaction client
martinscholz83 Jun 1, 2016
1a974e0
fix unit tests for reaction clients
martinscholz83 Jun 1, 2016
56434f2
fixed unit tests for reaction clients
martinscholz83 Jun 1, 2016
65f481f
fix constructur for unit tests
martinscholz83 Jun 1, 2016
d7d54c7
remove project reference
martinscholz83 Jun 1, 2016
9116c57
Merge remote-tracking branch 'refs/remotes/octokit/master' into stand…
martinscholz83 Jun 1, 2016
5fcc30d
added missing unit tests for observable reaction clients
martinscholz83 Jun 1, 2016
7794aaf
add integration test for CommitCommentReactionsClient
martinscholz83 Jun 2, 2016
d7ca61e
Merge remote-tracking branch 'refs/remotes/octokit/master' into stand…
martinscholz83 Jun 2, 2016
c8be919
fix projectreference
martinscholz83 Jun 2, 2016
07f34b8
clean up missing files
shiftkey Jun 2, 2016
bbcfae3
Merge pull request #1 from shiftkey/fix-mono-build
martinscholz83 Jun 2, 2016
93f9ecb
Add support for code searches without a search term (#1338)
dsplaisted Jun 3, 2016
96cc2d6
fix name of observable commit comment reaction client test
martinscholz83 Jun 3, 2016
2c8e119
Merge remote-tracking branch 'refs/remotes/octokit/master' into stand…
martinscholz83 Jun 3, 2016
df3a7c4
add AcceptHeader for delete reactions method
martinscholz83 Jun 4, 2016
ee2f78f
fix delete reactions method
martinscholz83 Jun 4, 2016
8944988
remove whitepaces
martinscholz83 Jun 6, 2016
9a68de1
remove parameter values fom reaction enum
martinscholz83 Jun 6, 2016
eff9ef4
add integration tests for reaction clients
martinscholz83 Jun 7, 2016
190abff
change UserId key to User
martinscholz83 Jun 8, 2016
26348e7
merge remote 'refs/remote/octokit/master' into stand-alone-reaction-c…
martinscholz83 Jun 8, 2016
69b1640
merge conflicts
martinscholz83 Jun 8, 2016
ff7bff0
Merge remote-tracking branch 'refs/remotes/octokit/master' into stand…
martinscholz83 Jun 9, 2016
e93ac2d
resolve conflicts
martinscholz83 Jun 9, 2016
af28943
Fix unit tests
martinscholz83 Jun 9, 2016
c1115f5
added new overloads on clients
alexander-efremov Jun 8, 2016
4ca64d4
added integration tests
alexander-efremov Jun 8, 2016
118bc31
fixed remarks
alexander-efremov Jun 9, 2016
988a649
fixed unut tests
alexander-efremov Jun 9, 2016
02a13df
modified xml docs
alexander-efremov Jun 9, 2016
8db1c10
Merge remote-tracking branch 'refs/remotes/octokit/master' into stand…
martinscholz83 Jun 9, 2016
ccd9654
fix some grammar and tests
martinscholz83 Jun 9, 2016
ff0c9dd
Fix grammar
ryangribble Jun 9, 2016
2107baf
Merge pull request #4 from TattsGroup/stand-alone-reaction-client
martinscholz83 Jun 10, 2016
7ad07d2
Merge remote-tracking branch 'refs/remotes/octokit/master' into stand…
martinscholz83 Jun 14, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;

namespace Octokit.Reactive
{
public interface IObservableCommitCommentReactionsClient
{
/// <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="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment id</param>
/// <param name="reaction">The reaction to create </param>
/// <returns></returns>
IObservable<Reaction> Create(string owner, string name, int number, NewReaction reaction);

/// <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="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment id</param>
/// <returns></returns>
IObservable<Reaction> GetAll(string owner, string name, int number);
}
}
28 changes: 28 additions & 0 deletions Octokit.Reactive/Clients/IObservableIssueCommentReactionsClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;

namespace Octokit.Reactive
{
public interface IObservableIssueCommentReactionsClient
{
/// <summary>
/// Creates a reaction for a specified Issue Comment
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#create-reaction-for-an-issue-comment</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment id</param>
/// <param name="reaction">The reaction to create </param>
/// <returns></returns>
IObservable<Reaction> Create(string owner, string name, int number, NewReaction reaction);

/// <summary>
/// List reactions for a specified Issue Comment
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#list-reactions-for-an-issue-comment</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment id</param>
/// <returns></returns>
IObservable<Reaction> GetAll(string owner, string name, int number);
}
}
28 changes: 28 additions & 0 deletions Octokit.Reactive/Clients/IObservableIssueReactionsClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;

namespace Octokit.Reactive
{
public interface IObservableIssueReactionsClient
{
/// <summary>
/// Creates a reaction for a specified Issue.
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#create-reaction-for-an-issue</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue id</param>
/// <param name="reaction">The reaction to create </param>
/// <returns></returns>
IObservable<Reaction> Create(string owner, string name, int number, NewReaction reaction);

/// <summary>
/// List reactions for a specified Issue.
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#list-reactions-for-an-issue</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue id</param>
/// <returns></returns>
IObservable<Reaction> GetAll(string owner, string name, int number);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;

namespace Octokit.Reactive
{
public interface IObservablePullRequestReviewCommentReactionsClient
{
/// <summary>
/// Creates a reaction for a specified Pull Request Review Comment.
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#create-reaction-for-a-pull-request-review-comment</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment id</param>
/// <param name="reaction">The reaction to create</param>
/// <returns></returns>
IObservable<Reaction> Create(string owner, string name, int number, NewReaction reaction);

/// <summary>
/// Get all reactions for a specified Pull Request Review Comment.
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#list-reactions-for-a-pull-request-review-comment</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment id</param>
/// <returns></returns>
IObservable<Reaction> GetAll(string owner, string name, int number);
}
}
48 changes: 48 additions & 0 deletions Octokit.Reactive/Clients/IObservableReactionsClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using System;
using System.Reactive;

namespace Octokit.Reactive
{
public interface IObservableReactionsClient
{
/// <summary>
/// Access GitHub's Reactions API for Commit Comments.
/// </summary>
/// <remarks>
/// Refer to the API documentation for more information: https://developer.github.com/v3/reactions/
/// </remarks>
IObservableCommitCommentReactionsClient CommitComment { get; }

/// <summary>
/// Access GitHub's Reactions API for Issues.
/// </summary>
/// <remarks>
/// Refer to the API documentation for more information: https://developer.github.com/v3/reactions/
/// </remarks>
IObservableIssueReactionsClient Issue { get; }

/// <summary>
/// Access GitHub's Reactions API for Issue Comments.
/// </summary>
/// <remarks>
/// Refer to the API documentation for more information: https://developer.github.com/v3/reactions/
/// </remarks>
IObservableIssueCommentReactionsClient IssueComment { get; }

/// <summary>
/// Access GitHub's Reactions API for Pull Request Review Comments.
/// </summary>
/// <remarks>
/// Refer to the API documentation for more information: https://developer.github.com/v3/reactions/
/// </remarks>
IObservablePullRequestReviewCommentReactionsClient PullRequestReviewComment { get; }

/// <summary>
/// Delete a reaction.
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#delete-a-reaction</remarks>
/// <param name="number">The reaction id</param>
/// <returns></returns>
IObservable<Unit> Delete(int number);
}
}
54 changes: 54 additions & 0 deletions Octokit.Reactive/Clients/ObservableCommitCommentReactionsClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using System;
using System.Reactive.Threading.Tasks;
using Octokit.Reactive.Internal;

namespace Octokit.Reactive
{
public class ObservableCommitCommentReactionsClient : IObservableCommitCommentReactionsClient
{
readonly ICommitCommentReactionsClient _client;
readonly IConnection _connection;

public ObservableCommitCommentReactionsClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, "client");

_client = client.Reaction.CommitComment;
_connection = client.Connection;
}

/// <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="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment id</param>
/// <param name="reaction">The reaction to create</param>
/// <returns></returns>
public IObservable<Reaction> Create(string owner, string name, int number, NewReaction reaction)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(reaction, "reaction");

return _client.Create(owner, name, number, reaction).ToObservable();
}

/// <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="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment id</param>
/// <returns></returns>
public IObservable<Reaction> GetAll(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");

return _connection.GetAndFlattenAllPages<Reaction>(ApiUrls.CommitCommentReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview);
}
}
}
55 changes: 55 additions & 0 deletions Octokit.Reactive/Clients/ObservableIssueCommentReactionsClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using Octokit.Reactive.Internal;
using System;
using System.Reactive.Linq;
using System.Reactive.Threading.Tasks;

namespace Octokit.Reactive
{
public class ObservableIssueCommentReactionsClient : IObservableIssueCommentReactionsClient
{
readonly IIssueCommentReactionsClient _client;
readonly IConnection _connection;

public ObservableIssueCommentReactionsClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, "client");

_client = client.Reaction.IssueComment;
_connection = client.Connection;
}

/// <summary>
/// Creates a reaction for a specified Issue Comment
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#create-reaction-for-an-issue-comment</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment id</param>
/// <param name="reaction">The reaction to create </param>
/// <returns></returns>
public IObservable<Reaction> Create(string owner, string name, int number, NewReaction reaction)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(reaction, "reaction");

return _client.Create(owner, name, number, reaction).ToObservable();
}

/// <summary>
/// List reactions for a specified Issue Comment
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#list-reactions-for-an-issue-comment</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment id</param>
/// <returns></returns>
public IObservable<Reaction> GetAll(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");

return _connection.GetAndFlattenAllPages<Reaction>(ApiUrls.IssueCommentReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview);
}
}
}
54 changes: 54 additions & 0 deletions Octokit.Reactive/Clients/ObservableIssueReactionsClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using Octokit.Reactive.Internal;
using System;
using System.Reactive.Threading.Tasks;

namespace Octokit.Reactive
{
public class ObservableIssueReactionsClient : IObservableIssueReactionsClient
{
readonly IIssueReactionsClient _client;
readonly IConnection _connection;

public ObservableIssueReactionsClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, "client");

_client = client.Reaction.Issue;
_connection = client.Connection;
}

/// <summary>
/// Creates a reaction for a specified Issue
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#create-reaction-for-an-issue</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue id</param>
/// <param name="reaction">The reaction to create</param>
/// <returns></returns>
public IObservable<Reaction> Create(string owner, string name, int number, NewReaction reaction)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(reaction, "reaction");

return _client.Create(owner, name, number, reaction).ToObservable();
}

/// <summary>
/// List reactions for a specified Issue
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#list-reactions-for-an-issue</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue id</param>
/// <returns></returns>
public IObservable<Reaction> GetAll(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");

return _connection.GetAndFlattenAllPages<Reaction>(ApiUrls.IssueReactions(owner, name, number), null, AcceptHeaders.ReactionsPreview);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using Octokit.Reactive.Internal;
using System;
using System.Collections.Generic;
using System.Reactive.Threading.Tasks;

namespace Octokit.Reactive
{
public class ObservablePullRequestReviewCommentReactionsClient : IObservablePullRequestReviewCommentReactionsClient
{
readonly IPullRequestReviewCommentReactionsClient _client;
readonly IConnection _connection;

public ObservablePullRequestReviewCommentReactionsClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, "client");

_client = client.Reaction.PullRequestReviewComment;
_connection = client.Connection;
}

/// <summary>
/// Creates a reaction for a specified Pull Request Review Comment.
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#create-reaction-for-a-pull-request-review-comment</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment id</param>
/// <param name="reaction">The reaction to create</param>
/// <returns></returns>
public IObservable<Reaction> Create(string owner, string name, int number, NewReaction reaction)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(reaction, "reaction");

return _client.Create(owner, name, number, reaction).ToObservable();
}

/// <summary>
/// Get all reactions for a specified Pull Request Review Comment.
/// </summary>
/// <remarks>https://developer.github.com/v3/reactions/#list-reactions-for-a-pull-request-review-comment</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The comment id</param>
/// <returns></returns>
public IObservable<Reaction> GetAll(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");

return _connection.GetAndFlattenAllPages<Reaction>(ApiUrls.PullRequestReviewCommentReaction(owner, name, number), null, AcceptHeaders.ReactionsPreview);
}
}
}
Loading