-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create RepositoryBranchesClient (#1437)
* Tidy up location of existing EditBranch tests * Create RepositoryBranchesClient and move the GetBranch GetAllBranches and EditBranch methods to it, obsoleting the old ones * Add tests for the new RepositoryBranchesClient (keeping old tests for RepositoriesClient around for now) * Disable obsolete warning on reactive client temporarily * Create observable repository branches client and move GetBranch, GetAllBranches, EditBranch methods to it, obsoleting the old ones * Add tests for observable repository branches client, leave old tests in place for now * Fix projects... * Fix whitespace
- Loading branch information
1 parent
23d9310
commit ef0da2f
Showing
26 changed files
with
1,424 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
Octokit.Reactive/Clients/IObservableRepositoryBranchesClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
using System; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace Octokit.Reactive | ||
{ | ||
/// <summary> | ||
/// A client for GitHub's Repository Branches API. | ||
/// </summary> | ||
/// <remarks> | ||
/// See the <a href="https://developer.github.com/v3/repos/branches">Repository Branches API documentation</a> for more details. | ||
/// </remarks> | ||
public interface IObservableRepositoryBranchesClient | ||
{ | ||
/// <summary> | ||
/// Gets all the branches for the specified repository. | ||
/// </summary> | ||
/// <remarks> | ||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-branches">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> | ||
IObservable<Branch> GetAll(string owner, string name); | ||
|
||
/// <summary> | ||
/// Gets all the branches for the specified repository. | ||
/// </summary> | ||
/// <remarks> | ||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-branches">API documentation</a> for more details | ||
/// </remarks> | ||
/// <param name="repositoryId">The ID of the repository</param> | ||
IObservable<Branch> GetAll(int repositoryId); | ||
|
||
/// <summary> | ||
/// Gets all the branches for the specified repository. | ||
/// </summary> | ||
/// <remarks> | ||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-branches">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="options">Options for changing the API response</param> | ||
IObservable<Branch> GetAll(string owner, string name, ApiOptions options); | ||
|
||
/// <summary> | ||
/// Gets all the branches for the specified repository. | ||
/// </summary> | ||
/// <remarks> | ||
/// See the <a href="https://developer.github.com/v3/repos/branches/#list-branches">API documentation</a> for more details | ||
/// </remarks> | ||
/// <param name="repositoryId">The ID of the repository</param> | ||
/// <param name="options">Options for changing the API response</param> | ||
IObservable<Branch> GetAll(int repositoryId, ApiOptions options); | ||
|
||
/// <summary> | ||
/// Gets the specified branch. | ||
/// </summary> | ||
/// <remarks> | ||
/// See the <a href="https://developer.github.com/v3/repos/branches/#get-branch">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> | ||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")] | ||
IObservable<Branch> Get(string owner, string name, string branch); | ||
|
||
/// <summary> | ||
/// Gets the specified branch. | ||
/// </summary> | ||
/// <remarks> | ||
/// See the <a href="https://developer.github.com/v3/repos/branches/#get-branch">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> | ||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")] | ||
IObservable<Branch> Get(int repositoryId, string branch); | ||
|
||
/// <summary> | ||
/// Edit the specified branch with the values given in <paramref name="update"/> | ||
/// </summary> | ||
/// <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">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(string owner, string name, string branch, BranchUpdate update); | ||
|
||
/// <summary> | ||
/// Edit the specified branch with the values given in <paramref name="update"/> | ||
/// </summary> | ||
/// <param name="repositoryId">The Id of the repository</param> | ||
/// <param name="branch">The name of the branch</param> | ||
/// <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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.