11from typing import Any , cast , Union
22
33from gitlab .base import RESTManager , RESTObject
4- from gitlab .mixins import NoUpdateMixin , ObjectDeleteMixin
4+ from gitlab .mixins import (
5+ NoUpdateMixin ,
6+ ObjectDeleteMixin ,
7+ CRUDMixin ,
8+ SaveMixin ,
9+ UpdateMethod ,
10+ )
511from gitlab .types import RequiredOptional
612
713__all__ = [
@@ -28,11 +34,11 @@ def get(
2834 return cast (ProjectBranch , super ().get (id = id , lazy = lazy , ** kwargs ))
2935
3036
31- class ProjectProtectedBranch (ObjectDeleteMixin , RESTObject ):
37+ class ProjectProtectedBranch (SaveMixin , ObjectDeleteMixin , RESTObject ):
3238 _id_attr = "name"
3339
3440
35- class ProjectProtectedBranchManager (NoUpdateMixin , RESTManager ):
41+ class ProjectProtectedBranchManager (CRUDMixin , RESTManager ):
3642 _path = "/projects/{project_id}/protected_branches"
3743 _obj_cls = ProjectProtectedBranch
3844 _from_parent_attrs = {"project_id" : "id" }
@@ -49,6 +55,7 @@ class ProjectProtectedBranchManager(NoUpdateMixin, RESTManager):
4955 "code_owner_approval_required" ,
5056 ),
5157 )
58+ _update_method = UpdateMethod .PATCH
5259
5360 def get (
5461 self , id : Union [str , int ], lazy : bool = False , ** kwargs : Any
0 commit comments