GitLabApiClient
GitLabApiClient copied to clipboard
BUG?: GitLabApiClient.Models.Branches.Requests.ProtectBranchRequest yields exception
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"}
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)