Files
octokit.net/Octokit.Reactive/Clients/IObservableRepositoryBranchesClient.cs
2016-09-15 02:15:11 +02:00

162 lines
8.4 KiB
C#

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(long 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(long 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(long 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("This existing implementation will cease to work when the Branch Protection API preview period ends. Please use other ObservableRepositoryBranchesClient methods instead.")]
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("This existing implementation will cease to work when the Branch Protection API preview period ends. Please use other ObservableRepositoryBranchesClient methods instead.")]
IObservable<Branch> Edit(long 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(long 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="branch">The name of the branch</param>
/// <param name="update">Branch protection settings</param>
IObservable<BranchProtectionSettings> UpdateBranchProtection(long 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(long repositoryId, string branch);
}
}