GitLabApiClient icon indicating copy to clipboard operation
GitLabApiClient copied to clipboard

BUG?: GitLabApiClient.Models.Branches.Requests.ProtectBranchRequest yields exception

Open th3br0 opened this issue 5 years ago • 1 comments

Trying to create and branch filters (in this case, all permission levels set to maintainer access level) yields an exception:

GitLabApiClient.GitLabException: {"error":"name is missing, push_access_level is invalid, push_access_level does not have a valid value, merge_access_level is invalid, merge_access_level does not have a valid value"}

th3br0 avatar Nov 12 '20 14:11 th3br0

I'm seeing the same thing:

        await gitLabClient.Branches.ProtectBranchAsync(
            projectId,
            new ProtectBranchRequest(
                branch.Name,
                pushAccessLevel: ProtectedRefAccessLevels.NO_ACCESS,
                mergeAccessLevel: ProtectedRefAccessLevels.DEVELOPER_ACCESS,
                unprotectAccessLevel: ProtectedRefAccessLevels.DEVELOPER_ACCESS));
GitLabApiClient.GitLabException: {"error":"name is missing, push_access_level is invalid, push_access_level does not have a valid value, merge_access_level is invalid, merge_access_level does not have a valid value, unprotect_access_level is invalid, unprotect_access_level does not have a valid value"}
   at GitLabApiClient.Internal.Http.GitLabApiRequestor.EnsureSuccessStatusCode(HttpResponseMessage responseMessage)
   at GitLabApiClient.Internal.Http.GitLabApiRequestor.Post[T](String url, Object data)
   at GitLabApiClient.BranchClient.ProtectBranchAsync(ProjectId projectId, ProtectBranchRequest request)

seanamosw avatar Dec 08 '20 19:12 seanamosw