mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-23 23:55:13 +00:00
Add ability to pass ApiOptions to PullRequestsClient.Files (#2553)
* Add ability to pass ApiOptions to PullRequestsClient.Files * Change Reactive PullRequestClient + Fix Test Mocking
This commit is contained in:
@@ -359,12 +359,37 @@ namespace Octokit.Reactive
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="number">The pull request number</param>
|
||||
public IObservable<PullRequestFile> Files(string owner, string name, int number)
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
public IObservable<PullRequestFile> Files(string owner, string name, int number, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
|
||||
|
||||
return _connection.GetAndFlattenAllPages<PullRequestFile>(ApiUrls.PullRequestFiles(owner, name, number));
|
||||
return _connection.GetAndFlattenAllPages<PullRequestFile>(ApiUrls.PullRequestFiles(owner, name, number), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the list of files on a pull request.
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/pulls/#list-pull-requests-files</remarks>
|
||||
/// <param name="owner">The owner of the repository</param>
|
||||
/// <param name="name">The name of the repository</param>
|
||||
/// <param name="number">The pull request number</param>
|
||||
public IObservable<PullRequestFile> Files(string owner, string name, int number)
|
||||
{
|
||||
return Files(owner, name, number, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the list of files on a pull request.
|
||||
/// </summary>
|
||||
/// <remarks>https://developer.github.com/v3/pulls/#list-pull-requests-files</remarks>
|
||||
/// <param name="repositoryId">The Id of the repository</param>
|
||||
/// <param name="number">The pull request number</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
public IObservable<PullRequestFile> Files(long repositoryId, int number, ApiOptions options)
|
||||
{
|
||||
return _connection.GetAndFlattenAllPages<PullRequestFile>(ApiUrls.PullRequestFiles(repositoryId, number), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -375,7 +400,7 @@ namespace Octokit.Reactive
|
||||
/// <param name="number">The pull request number</param>
|
||||
public IObservable<PullRequestFile> Files(long repositoryId, int number)
|
||||
{
|
||||
return _connection.GetAndFlattenAllPages<PullRequestFile>(ApiUrls.PullRequestFiles(repositoryId, number));
|
||||
return Files(repositoryId, number, ApiOptions.None);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user