Implement Get Update and Delete BranchProtection methods in ObservableRepositoryBranchesClient

Add unit tests for Observable methods
This commit is contained in:
Ryan Gribble
2016-08-10 15:30:15 +10:00
parent b0bc7078c3
commit 998af893f5
3 changed files with 311 additions and 2 deletions
@@ -92,5 +92,69 @@ namespace Octokit.Reactive
/// <param name="update">New values to update the branch with</param>
[Obsolete("BranchProtection preview functionality in the GitHub API has had breaking changes. This existing implementation will cease to work when the preview period ends.")]
IObservable<Branch> Edit(int repositoryId, string branch, BranchUpdate update);
/// <summary>
/// Get the branch protection settings for the specified branch />
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#get-branch-protection">API documentation</a> for more details
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="branch">The name of the branch</param>
IObservable<BranchProtectionSettings> GetBranchProtection(string owner, string name, string branch);
/// <summary>
/// Get the branch protection settings for the specified branch />
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#get-branch-protection">API documentation</a> for more details
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="branch">The name of the branch</param>
IObservable<BranchProtectionSettings> GetBranchProtection(int repositoryId, string branch);
/// <summary>
/// Update the branch protection settings for the specified branch />
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#update-branch-protection">API documentation</a> for more details
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="branch">The name of the branch</param>
/// <param name="update">Branch protection settings</param>
IObservable<BranchProtectionSettings> UpdateBranchProtection(string owner, string name, string branch, BranchProtectionSettingsUpdate update);
/// <summary>
/// Update the branch protection settings for the specified branch />
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#update-branch-protection">API documentation</a> for more details
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="update">Branch protection settings</param>
IObservable<BranchProtectionSettings> UpdateBranchProtection(int repositoryId, string branch, BranchProtectionSettingsUpdate update);
/// <summary>
/// Remove the branch protection settings for the specified branch />
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#remove-branch-protection">API documentation</a> for more details
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="branch">The name of the branch</param>
IObservable<bool> DeleteBranchProtection(string owner, string name, string branch);
/// <summary>
/// Remove the branch protection settings for the specified branch />
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/branches/#remove-branch-protection">API documentation</a> for more details
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="branch">The name of the branch</param>
IObservable<bool> DeleteBranchProtection(int repositoryId, string branch);
}
}