diff options
Diffstat (limited to 'gitlab/v4/objects/templates.py')
-rw-r--r-- | gitlab/v4/objects/templates.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gitlab/v4/objects/templates.py b/gitlab/v4/objects/templates.py index 04de463..bbe2ae6 100644 --- a/gitlab/v4/objects/templates.py +++ b/gitlab/v4/objects/templates.py @@ -1,3 +1,5 @@ +from typing import Any, cast, Union + from gitlab.base import RESTManager, RESTObject from gitlab.mixins import RetrieveMixin @@ -21,6 +23,9 @@ class DockerfileManager(RetrieveMixin, RESTManager): _path = "/templates/dockerfiles" _obj_cls = Dockerfile + def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> Dockerfile: + return cast(Dockerfile, super().get(id=id, lazy=lazy, **kwargs)) + class Gitignore(RESTObject): _id_attr = "name" @@ -30,6 +35,9 @@ class GitignoreManager(RetrieveMixin, RESTManager): _path = "/templates/gitignores" _obj_cls = Gitignore + def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> Gitignore: + return cast(Gitignore, super().get(id=id, lazy=lazy, **kwargs)) + class Gitlabciyml(RESTObject): _id_attr = "name" @@ -39,6 +47,11 @@ class GitlabciymlManager(RetrieveMixin, RESTManager): _path = "/templates/gitlab_ci_ymls" _obj_cls = Gitlabciyml + def get( + self, id: Union[str, int], lazy: bool = False, **kwargs: Any + ) -> Gitlabciyml: + return cast(Gitlabciyml, super().get(id=id, lazy=lazy, **kwargs)) + class License(RESTObject): _id_attr = "key" @@ -49,3 +62,6 @@ class LicenseManager(RetrieveMixin, RESTManager): _obj_cls = License _list_filters = ("popular",) _optional_get_attrs = ("project", "fullname") + + def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> License: + return cast(License, super().get(id=id, lazy=lazy, **kwargs)) |