From 8b75a7712dd1665d4b3eabb0c4594e80ab5e5308 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Sat, 6 Nov 2021 20:51:04 -0700 Subject: chore: add type-hints to multiple files in gitlab/v4/objects/ Add and/or check type-hints for the following files gitlab.v4.objects.access_requests gitlab.v4.objects.applications gitlab.v4.objects.broadcast_messages gitlab.v4.objects.deployments gitlab.v4.objects.keys gitlab.v4.objects.merge_trains gitlab.v4.objects.namespaces gitlab.v4.objects.pages gitlab.v4.objects.personal_access_tokens gitlab.v4.objects.project_access_tokens gitlab.v4.objects.tags gitlab.v4.objects.templates gitlab.v4.objects.triggers Add a 'get' method with the correct type for Managers derived from GetMixin. --- gitlab/v4/objects/triggers.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gitlab/v4/objects/triggers.py') diff --git a/gitlab/v4/objects/triggers.py b/gitlab/v4/objects/triggers.py index f203d93..6ff2517 100644 --- a/gitlab/v4/objects/triggers.py +++ b/gitlab/v4/objects/triggers.py @@ -1,3 +1,5 @@ +from typing import Any, cast, Union + from gitlab.base import RequiredOptional, RESTManager, RESTObject from gitlab.mixins import CRUDMixin, ObjectDeleteMixin, SaveMixin @@ -17,3 +19,8 @@ class ProjectTriggerManager(CRUDMixin, RESTManager): _from_parent_attrs = {"project_id": "id"} _create_attrs = RequiredOptional(required=("description",)) _update_attrs = RequiredOptional(required=("description",)) + + def get( + self, id: Union[str, int], lazy: bool = False, **kwargs: Any + ) -> ProjectTrigger: + return cast(ProjectTrigger, super().get(id=id, lazy=lazy, **kwargs)) -- cgit v1.2.1