diff options
Diffstat (limited to 'gitlab/v4/objects/branches.py')
-rw-r--r-- | gitlab/v4/objects/branches.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gitlab/v4/objects/branches.py b/gitlab/v4/objects/branches.py index 407765c..d06d6b4 100644 --- a/gitlab/v4/objects/branches.py +++ b/gitlab/v4/objects/branches.py @@ -1,3 +1,5 @@ +from typing import Any, cast, Union + from gitlab.base import RequiredOptional, RESTManager, RESTObject from gitlab.mixins import NoUpdateMixin, ObjectDeleteMixin @@ -19,6 +21,11 @@ class ProjectBranchManager(NoUpdateMixin, RESTManager): _from_parent_attrs = {"project_id": "id"} _create_attrs = RequiredOptional(required=("branch", "ref")) + def get( + self, id: Union[str, int], lazy: bool = False, **kwargs: Any + ) -> ProjectBranch: + return cast(ProjectBranch, super().get(id=id, lazy=lazy, **kwargs)) + class ProjectProtectedBranch(ObjectDeleteMixin, RESTObject): _id_attr = "name" @@ -40,3 +47,8 @@ class ProjectProtectedBranchManager(NoUpdateMixin, RESTManager): "code_owner_approval_required", ), ) + + def get( + self, id: Union[str, int], lazy: bool = False, **kwargs: Any + ) -> ProjectProtectedBranch: + return cast(ProjectProtectedBranch, super().get(id=id, lazy=lazy, **kwargs)) |