diff options
| author | John L. Villalovos <john@sodarock.com> | 2021-11-06 20:51:04 -0700 | 
|---|---|---|
| committer | John L. Villalovos <john@sodarock.com> | 2021-11-07 12:35:23 -0800 | 
| commit | 8b75a7712dd1665d4b3eabb0c4594e80ab5e5308 (patch) | |
| tree | 3f1b9a0574430272bc5e7ede26f77a235b789c4b /gitlab/v4/objects/triggers.py | |
| parent | f3688dcf2dea33f5e17e456f86f8f50ff9312deb (diff) | |
| download | gitlab-8b75a7712dd1665d4b3eabb0c4594e80ab5e5308.tar.gz | |
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.
Diffstat (limited to 'gitlab/v4/objects/triggers.py')
| -rw-r--r-- | gitlab/v4/objects/triggers.py | 7 | 
1 files changed, 7 insertions, 0 deletions
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))  | 
