diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2021-11-08 19:06:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-08 19:06:32 +0100 |
commit | 472b300154c5e59289d83f0b34d24bc52eb9b6da (patch) | |
tree | 71312fe159fcc62ace0aeb24be94072ee4cf33cf /gitlab/v4/objects/clusters.py | |
parent | 9a2f54cf044929dfc3fd89714ce657fa839e35d0 (diff) | |
parent | 7828ba2fd13c833c118a673bac09b215587ba33b (diff) | |
download | gitlab-472b300154c5e59289d83f0b34d24bc52eb9b6da.tar.gz |
Merge pull request #1680 from python-gitlab/jlvillal/mypy_small_files_1
chore: enforce type-hints on most files in gitlab/v4/objects/
Diffstat (limited to 'gitlab/v4/objects/clusters.py')
-rw-r--r-- | gitlab/v4/objects/clusters.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gitlab/v4/objects/clusters.py b/gitlab/v4/objects/clusters.py index 3dcf653..a6ff670 100644 --- a/gitlab/v4/objects/clusters.py +++ b/gitlab/v4/objects/clusters.py @@ -1,3 +1,5 @@ +from typing import Any, cast, Dict, Optional + from gitlab import exceptions as exc from gitlab.base import RequiredOptional, RESTManager, RESTObject from gitlab.mixins import CreateMixin, CRUDMixin, ObjectDeleteMixin, SaveMixin @@ -33,7 +35,9 @@ class GroupClusterManager(CRUDMixin, RESTManager): ) @exc.on_http_error(exc.GitlabStopError) - def create(self, data, **kwargs): + def create( + self, data: Optional[Dict[str, Any]] = None, **kwargs: Any + ) -> GroupCluster: """Create a new object. Args: @@ -51,7 +55,7 @@ class GroupClusterManager(CRUDMixin, RESTManager): the data sent by the server """ path = f"{self.path}/user" - return CreateMixin.create(self, data, path=path, **kwargs) + return cast(GroupCluster, CreateMixin.create(self, data, path=path, **kwargs)) class ProjectCluster(SaveMixin, ObjectDeleteMixin, RESTObject): @@ -77,7 +81,9 @@ class ProjectClusterManager(CRUDMixin, RESTManager): ) @exc.on_http_error(exc.GitlabStopError) - def create(self, data, **kwargs): + def create( + self, data: Optional[Dict[str, Any]] = None, **kwargs: Any + ) -> ProjectCluster: """Create a new object. Args: @@ -95,4 +101,4 @@ class ProjectClusterManager(CRUDMixin, RESTManager): the data sent by the server """ path = f"{self.path}/user" - return CreateMixin.create(self, data, path=path, **kwargs) + return cast(ProjectCluster, CreateMixin.create(self, data, path=path, **kwargs)) |