Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protected Branches Preview API Update - main methods #1407

Closed
shiftkey opened this issue Jun 28, 2016 · 2 comments
Closed

Protected Branches Preview API Update - main methods #1407

shiftkey opened this issue Jun 28, 2016 · 2 comments
Assignees
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone

Comments

@shiftkey
Copy link
Member

Announcement

Just noting this down so we don't miss it. I haven't had a chance to look over the actual work required.

@ryangribble
Copy link
Contributor

Yep I was about to post this too 😀

Pretty major changes, as previously all protection settings were done via 1 object and the single "update branch" endpoint, whereas now protection is pulled apart into various sub components (enabled, required contexts, user/team push restrictions) but overall a much better approach for the feature 👍

@ryangribble
Copy link
Contributor

ryangribble commented Aug 10, 2016

For complete coverage of all the new API endpoints we will need to add 40 methods!

Given that some are only a "convenience" (since you can manage everything with the top level endpoints anyway), this issue will cover implementing the following top level methods:

        Task<BranchProtectionSettings> GetBranchProtection(string owner, string name, string branch);
        Task<BranchProtectionSettings> GetBranchProtection(int repositoryId, string branch);
        Task<BranchProtectionSettings> UpdateBranchProtection(string owner, string name, string branch, BranchProtectionSettingsUpdate update);
        Task<BranchProtectionSettings> UpdateBranchProtection(int repositoryId, string branch, BranchProtectionSettingsUpdate update);
        Task<bool> DeleteBranchProtection(string owner, string name, string branch);
        Task<bool> DeleteBranchProtection(int repositoryId, string branch);

And the remainder will be moved to new issues

        Task<BranchProtectionRequiredStatusChecks> GetRequiredStatusChecks(string owner, string name, string branch);
        Task<BranchProtectionRequiredStatusChecks> GetRequiredStatusChecks(int repositoryId, string branch);
        Task<BranchProtectionRequiredStatusChecks> UpdateRequiredStatusChecks(string owner, string name, string branch, BranchProtectionRequiredStatusChecks update);
        Task<BranchProtectionRequiredStatusChecks> UpdateRequiredStatusChecks(int repositoryId, string branch, BranchProtectionRequiredStatusChecks update);
        Task<bool> DeleteRequiredStatusChecks(string owner, string name, string branch);
        Task<bool> DeleteRequiredStatusChecks(int repositoryId, string branch);

        Task<IReadOnlyList<string>> GetRequiredStatusCheckContexts(string owner, string name, string branch);
        Task<IReadOnlyList<string>> GetRequiredStatusCheckContexts(int repositoryId, string branch);
        Task<IReadOnlyList<string>> UpdateRequiredStatusCheckContexts(string owner, string name, string branch, IReadOnlyList<string> contexts);
        Task<IReadOnlyList<string>> UpdateRequiredStatusCheckContexts(int repositoryId, string branch, IReadOnlyList<string> contexts);
        Task<IReadOnlyList<string>> AddRequiredStatusCheckContext(string owner, string name, string branch, string context);
        Task<IReadOnlyList<string>> AddRequiredStatusCheckContext(int repositoryId, string branch, string context);
        Task<IReadOnlyList<string>> DeleteRequiredStatusCheckContext(string owner, string name, string branch, string context);
        Task<IReadOnlyList<string>> DeleteRequiredStatusCheckContext(int repositoryId, string branch, string context);

        Task<ProtectedBranchRestrictions> GetProtectedBranchRestrictions(string owner, string name, string branch);
        Task<ProtectedBranchRestrictions> GetProtectedBranchRestrictions(int repositoryId, string branch);
        Task<bool> DeleteProtectedBranchRestrictions(string owner, string name, string branch);
        Task<bool> DeleteProtectedBranchRestrictions(int repositoryId, string branch);

        Task<IReadOnlyList<Team>> GetProtectedBranchTeamRestrictions(string owner, string name, string branch);
        Task<IReadOnlyList<Team>> GetProtectedBranchTeamRestrictions(int repositoryId, string branch);
        Task<IReadOnlyList<Team>> SetProtectedBranchTeamRestrictions(string owner, string name, string branch, IReadOnlyList<string> teams);
        Task<IReadOnlyList<Team>> SetProtectedBranchTeamRestrictions(int repositoryId, string branch, IReadOnlyList<string> teams);
        Task<IReadOnlyList<Team>> AddProtectedBranchTeamRestriction(string owner, string name, string branch, string team);
        Task<IReadOnlyList<Team>> AddProtectedBranchTeamRestriction(int repositoryId, string branch, string team);
        Task<IReadOnlyList<Team>> DeleteProtectedBranchTeamRestriction(string owner, string name, string branch);
        Task<IReadOnlyList<Team>> DeleteProtectedBranchTeamRestriction(int repositoryId, string branch);

        Task<IReadOnlyList<User>> GetProtectedBranchUserRestrictions(string owner, string name, string branch);
        Task<IReadOnlyList<User>> GetProtectedBranchUserRestrictions(int repositoryId, string branch);
        Task<IReadOnlyList<User>> SetProtectedBranchUserRestrictions(string owner, string name, string branch, IReadOnlyList<string> users);
        Task<IReadOnlyList<User>> SetProtectedBranchUserRestrictions(int repositoryId, string branch, IReadOnlyList<string> users);
        Task<IReadOnlyList<User>> AddProtectedBranchUserRestriction(string owner, string name, string branch, string user);
        Task<IReadOnlyList<User>> AddProtectedBranchUserRestriction(int repositoryId, string branch, string user);
        Task<IReadOnlyList<User>> DeleteProtectedBranchUserRestriction(string owner, string name, string branch);
        Task<IReadOnlyList<User>> DeleteProtectedBranchUserRestriction(int repositoryId, string branch);

@ryangribble ryangribble changed the title Protected Branches Preview API Update Protected Branches Preview API Update - main methods Aug 10, 2016
@ryangribble ryangribble mentioned this issue Aug 15, 2016
10 tasks
@nickfloyd nickfloyd added Status: Up for grabs Issues that are ready to be worked on by anyone and removed up-for-grabs labels Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone
Projects
None yet
Development

No branches or pull requests

3 participants