diff --git a/Octokit.Tests/Clients/RepositoryBranchesClientTests.cs b/Octokit.Tests/Clients/RepositoryBranchesClientTests.cs index 8d1192f7..f061ff5c 100644 --- a/Octokit.Tests/Clients/RepositoryBranchesClientTests.cs +++ b/Octokit.Tests/Clients/RepositoryBranchesClientTests.cs @@ -257,8 +257,7 @@ namespace Octokit.Tests.Clients var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var update = new BranchProtectionSettingsUpdate( - new BranchProtectionRequiredStatusChecksUpdate(true, true, new[] { "test" }), - new ProtectedBranchRestrictionsUpdate(null, null)); + new BranchProtectionRequiredStatusChecksUpdate(true, true, new[] { "test" })); const string previewAcceptsHeader = "application/vnd.github.loki-preview+json"; client.UpdateBranchProtection("owner", "repo", "branch", update); @@ -273,8 +272,7 @@ namespace Octokit.Tests.Clients var connection = Substitute.For(); var client = new RepositoryBranchesClient(connection); var update = new BranchProtectionSettingsUpdate( - new BranchProtectionRequiredStatusChecksUpdate(true, true, new[] { "test" }), - new ProtectedBranchRestrictionsUpdate(null, null)); + new BranchProtectionRequiredStatusChecksUpdate(true, true, new[] { "test" })); const string previewAcceptsHeader = "application/vnd.github.loki-preview+json"; client.UpdateBranchProtection(1, "branch", update); @@ -288,8 +286,7 @@ namespace Octokit.Tests.Clients { var client = new RepositoryBranchesClient(Substitute.For()); var update = new BranchProtectionSettingsUpdate( - new BranchProtectionRequiredStatusChecksUpdate(true, true, new[] { "test" }), - new ProtectedBranchRestrictionsUpdate(null, null)); + new BranchProtectionRequiredStatusChecksUpdate(true, true, new[] { "test" })); await Assert.ThrowsAsync(() => client.UpdateBranchProtection(null, "repo", "branch", update)); await Assert.ThrowsAsync(() => client.UpdateBranchProtection("owner", null, "branch", update)); diff --git a/Octokit/Models/Request/BranchProtectionUpdate.cs b/Octokit/Models/Request/BranchProtectionUpdate.cs index fc198474..85458621 100644 --- a/Octokit/Models/Request/BranchProtectionUpdate.cs +++ b/Octokit/Models/Request/BranchProtectionUpdate.cs @@ -11,6 +11,16 @@ namespace Octokit [DebuggerDisplay("{DebuggerDisplay,nq}")] public class BranchProtectionSettingsUpdate { + /// + /// Create a BranchProtection update request + /// + /// Specifies the requested status check settings + public BranchProtectionSettingsUpdate(BranchProtectionRequiredStatusChecksUpdate requiredStatusChecks) + { + RequiredStatusChecks = requiredStatusChecks; + Restrictions = null; + } + /// /// Create a BranchProtection update request ///