22GitLab API:
33https://docs.gitlab.com/ee/api/audit_events.html
44"""
5+ import warnings
56
67from gitlab .base import RESTManager , RESTObject
78from gitlab .mixins import RetrieveMixin
89
910__all__ = [
1011 "AuditEvent" ,
1112 "AuditEventManager" ,
13+ "GroupAuditEvent" ,
14+ "GroupAuditEventManager" ,
15+ "ProjectAuditEvent" ,
16+ "ProjectAuditEventManager" ,
1217 "ProjectAudit" ,
1318 "ProjectAuditManager" ,
1419]
@@ -24,12 +29,47 @@ class AuditEventManager(RetrieveMixin, RESTManager):
2429 _list_filters = ("created_after" , "created_before" , "entity_type" , "entity_id" )
2530
2631
27- class ProjectAudit (RESTObject ):
32+ class GroupAuditEvent (RESTObject ):
2833 _id_attr = "id"
2934
3035
31- class ProjectAuditManager (RetrieveMixin , RESTManager ):
36+ class GroupAuditEventManager (RetrieveMixin , RESTManager ):
37+ _path = "/groups/%(group_id)s/audit_events"
38+ _obj_cls = GroupAuditEvent
39+ _from_parent_attrs = {"group_id" : "id" }
40+ _list_filters = ("created_after" , "created_before" )
41+
42+
43+ class ProjectAuditEvent (RESTObject ):
44+ _id_attr = "id"
45+
46+ def __init_subclass__ (self ):
47+ warnings .warn (
48+ "This class has been renamed to ProjectAuditEvent "
49+ "and will be removed in a future release." ,
50+ DeprecationWarning ,
51+ 2 ,
52+ )
53+
54+
55+ class ProjectAuditEventManager (RetrieveMixin , RESTManager ):
3256 _path = "/projects/%(project_id)s/audit_events"
33- _obj_cls = ProjectAudit
57+ _obj_cls = ProjectAuditEvent
3458 _from_parent_attrs = {"project_id" : "id" }
3559 _list_filters = ("created_after" , "created_before" )
60+
61+ def __init_subclass__ (self ):
62+ warnings .warn (
63+ "This class has been renamed to ProjectAuditEventManager "
64+ "and will be removed in a future release." ,
65+ DeprecationWarning ,
66+ 2 ,
67+ )
68+
69+
70+ class ProjectAudit (ProjectAuditEvent ):
71+ pass
72+
73+
74+ class ProjectAuditManager (ProjectAuditEventManager ):
75+ pass
0 commit comments