summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects/clusters.py
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-11-16 23:09:08 +0100
committerGitHub <noreply@github.com>2021-11-16 23:09:08 +0100
commit0951989cc4eaabc2e2bd82adeb38936d145ddec2 (patch)
tree32cc9473ec28cc3d10be3baff28a74e8a17ac718 /gitlab/v4/objects/clusters.py
parenta553ee76affc6e1030ab0464a8bb998168239f4a (diff)
parent46773a82565cef231dc3391c12f296ac307cb95c (diff)
downloadgitlab-0951989cc4eaabc2e2bd82adeb38936d145ddec2.tar.gz
Merge pull request #1681 from python-gitlab/jlvillal/mypy_ensure_type_hints
Ensure get() methods have correct type-hints
Diffstat (limited to 'gitlab/v4/objects/clusters.py')
-rw-r--r--gitlab/v4/objects/clusters.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/gitlab/v4/objects/clusters.py b/gitlab/v4/objects/clusters.py
index 4821b70..5491654 100644
--- a/gitlab/v4/objects/clusters.py
+++ b/gitlab/v4/objects/clusters.py
@@ -1,4 +1,4 @@
-from typing import Any, cast, Dict, Optional
+from typing import Any, cast, Dict, Optional, Union
from gitlab import exceptions as exc
from gitlab.base import RequiredOptional, RESTManager, RESTObject
@@ -57,6 +57,11 @@ class GroupClusterManager(CRUDMixin, RESTManager):
path = f"{self.path}/user"
return cast(GroupCluster, CreateMixin.create(self, data, path=path, **kwargs))
+ def get(
+ self, id: Union[str, int], lazy: bool = False, **kwargs: Any
+ ) -> GroupCluster:
+ return cast(GroupCluster, super().get(id=id, lazy=lazy, **kwargs))
+
class ProjectCluster(SaveMixin, ObjectDeleteMixin, RESTObject):
pass
@@ -102,3 +107,8 @@ class ProjectClusterManager(CRUDMixin, RESTManager):
"""
path = f"{self.path}/user"
return cast(ProjectCluster, CreateMixin.create(self, data, path=path, **kwargs))
+
+ def get(
+ self, id: Union[str, int], lazy: bool = False, **kwargs: Any
+ ) -> ProjectCluster:
+ return cast(ProjectCluster, super().get(id=id, lazy=lazy, **kwargs))