mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-08 04:40:54 +00:00
Add ability to specify 'since' request parameter to issue comments (#2008)
* Update issue comments client to allow returning comments 'since' a specific date * Update observable issue comments client to allow returning comments 'since' a specific date * Add test cases to cover newly added methods
This commit is contained in:
committed by
Brendan Forster
parent
63a4deae35
commit
9e5a76886f
@@ -205,7 +205,7 @@ namespace Octokit.Reactive
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
Ensure.ArgumentNotNull(options, nameof(options));
|
||||
|
||||
return _connection.GetAndFlattenAllPages<IssueComment>(ApiUrls.IssueComments(owner, name, number), null, AcceptHeaders.ReactionsPreview, options);
|
||||
return GetAllForIssue(owner, name, number, new IssueCommentRequest(), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -219,7 +219,74 @@ namespace Octokit.Reactive
|
||||
{
|
||||
Ensure.ArgumentNotNull(options, nameof(options));
|
||||
|
||||
return _connection.GetAndFlattenAllPages<IssueComment>(ApiUrls.IssueComments(repositoryId, number), options);
|
||||
return GetAllForIssue(repositoryId, number, new IssueCommentRequest(), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets Issue Comments for a specified Issue.
|
||||
/// </summary>
|
||||
/// <remarks>http://developer.github.com/v3/issues/comments/#list-comments-on-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 number</param>
|
||||
/// <param name="request">The sorting <see cref="IssueCommentRequest">parameters</see></param>
|
||||
public IObservable<IssueComment> GetAllForIssue(string owner, string name, int number, IssueCommentRequest request)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
Ensure.ArgumentNotNull(request, nameof(request));
|
||||
|
||||
return GetAllForIssue(owner, name, number, request, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets Issue Comments for a specified Issue.
|
||||
/// </summary>
|
||||
/// <remarks>http://developer.github.com/v3/issues/comments/#list-comments-on-an-issue</remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="number">The issue number</param>
|
||||
/// <param name="request">The sorting <see cref="IssueCommentRequest">parameters</see></param>
|
||||
public IObservable<IssueComment> GetAllForIssue(long repositoryId, int number, IssueCommentRequest request)
|
||||
{
|
||||
Ensure.ArgumentNotNull(request, nameof(request));
|
||||
|
||||
return GetAllForIssue(repositoryId, number, request, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets Issue Comments for a specified Issue.
|
||||
/// </summary>
|
||||
/// <remarks>http://developer.github.com/v3/issues/comments/#list-comments-on-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 number</param>
|
||||
/// <param name="request">The sorting <see cref="IssueCommentRequest">parameters</see></param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
public IObservable<IssueComment> GetAllForIssue(string owner, string name, int number, IssueCommentRequest request, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
Ensure.ArgumentNotNull(request, nameof(request));
|
||||
Ensure.ArgumentNotNull(options, nameof(options));
|
||||
|
||||
return _connection.GetAndFlattenAllPages<IssueComment>(ApiUrls.IssueComments(owner, name, number), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets Issue Comments for a specified Issue.
|
||||
/// </summary>
|
||||
/// <remarks>http://developer.github.com/v3/issues/comments/#list-comments-on-an-issue</remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="number">The issue number</param>
|
||||
/// <param name="request">The sorting <see cref="IssueCommentRequest">parameters</see></param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
public IObservable<IssueComment> GetAllForIssue(long repositoryId, int number, IssueCommentRequest request, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNull(request, nameof(request));
|
||||
Ensure.ArgumentNotNull(options, nameof(options));
|
||||
|
||||
return _connection.GetAndFlattenAllPages<IssueComment>(ApiUrls.IssueComments(repositoryId, number), request.ToParametersDictionary(), AcceptHeaders.ReactionsPreview, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user