diff options
Diffstat (limited to 'gitlab/v4/objects/audit_events.py')
-rw-r--r-- | gitlab/v4/objects/audit_events.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gitlab/v4/objects/audit_events.py b/gitlab/v4/objects/audit_events.py index ab632bb..649dc9d 100644 --- a/gitlab/v4/objects/audit_events.py +++ b/gitlab/v4/objects/audit_events.py @@ -2,6 +2,8 @@ GitLab API: https://docs.gitlab.com/ee/api/audit_events.html """ +from typing import Any, cast, Union + from gitlab.base import RESTManager, RESTObject from gitlab.mixins import RetrieveMixin @@ -26,6 +28,9 @@ class AuditEventManager(RetrieveMixin, RESTManager): _obj_cls = AuditEvent _list_filters = ("created_after", "created_before", "entity_type", "entity_id") + def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> AuditEvent: + return cast(AuditEvent, super().get(id=id, lazy=lazy, **kwargs)) + class GroupAuditEvent(RESTObject): _id_attr = "id" @@ -37,6 +42,11 @@ class GroupAuditEventManager(RetrieveMixin, RESTManager): _from_parent_attrs = {"group_id": "id"} _list_filters = ("created_after", "created_before") + def get( + self, id: Union[str, int], lazy: bool = False, **kwargs: Any + ) -> GroupAuditEvent: + return cast(GroupAuditEvent, super().get(id=id, lazy=lazy, **kwargs)) + class ProjectAuditEvent(RESTObject): _id_attr = "id" @@ -48,6 +58,11 @@ class ProjectAuditEventManager(RetrieveMixin, RESTManager): _from_parent_attrs = {"project_id": "id"} _list_filters = ("created_after", "created_before") + def get( + self, id: Union[str, int], lazy: bool = False, **kwargs: Any + ) -> ProjectAuditEvent: + return cast(ProjectAuditEvent, super().get(id=id, lazy=lazy, **kwargs)) + class ProjectAudit(ProjectAuditEvent): pass |