diff options
author | Nejc Habjan <hab.nejc@gmail.com> | 2021-05-27 00:44:46 +0200 |
---|---|---|
committer | John Villalovos <john@sodarock.com> | 2021-05-30 08:50:09 -0700 |
commit | f731707f076264ebea65afc814e4aca798970953 (patch) | |
tree | 31c5d4a939ca9bf40582a344725284e0a846fd34 /gitlab | |
parent | 1b70580020825adf2d1f8c37803bc4655a97be41 (diff) | |
download | gitlab-f731707f076264ebea65afc814e4aca798970953.tar.gz |
feat(objects): support all issues statistics endpoints
Diffstat (limited to 'gitlab')
-rw-r--r-- | gitlab/client.py | 1 | ||||
-rw-r--r-- | gitlab/v4/objects/groups.py | 2 | ||||
-rw-r--r-- | gitlab/v4/objects/statistics.py | 23 |
3 files changed, 26 insertions, 0 deletions
diff --git a/gitlab/client.py b/gitlab/client.py index fa9a394..fe018af 100644 --- a/gitlab/client.py +++ b/gitlab/client.py @@ -118,6 +118,7 @@ class Gitlab(object): self.groups = objects.GroupManager(self) self.hooks = objects.HookManager(self) self.issues = objects.IssueManager(self) + self.issuesstatistics = objects.IssuesStatisticsManager(self) self.ldapgroups = objects.LDAPGroupManager(self) self.licenses = objects.LicenseManager(self) self.namespaces = objects.NamespaceManager(self) diff --git a/gitlab/v4/objects/groups.py b/gitlab/v4/objects/groups.py index 860a056..6a569ca 100644 --- a/gitlab/v4/objects/groups.py +++ b/gitlab/v4/objects/groups.py @@ -26,6 +26,7 @@ from .notification_settings import GroupNotificationSettingsManager # noqa: F40 from .packages import GroupPackageManager # noqa: F401 from .projects import GroupProjectManager # noqa: F401 from .runners import GroupRunnerManager # noqa: F401 +from .statistics import GroupIssuesStatisticsManager # noqa: F401 from .variables import GroupVariableManager # noqa: F401 __all__ = [ @@ -52,6 +53,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject): ("epics", "GroupEpicManager"), ("imports", "GroupImportManager"), ("issues", "GroupIssueManager"), + ("issuesstatistics", "GroupIssuesStatisticsManager"), ("labels", "GroupLabelManager"), ("members", "GroupMemberManager"), ("members_all", "GroupMemberAllManager"), diff --git a/gitlab/v4/objects/statistics.py b/gitlab/v4/objects/statistics.py index 2e3edc7..5d7c19e 100644 --- a/gitlab/v4/objects/statistics.py +++ b/gitlab/v4/objects/statistics.py @@ -2,8 +2,12 @@ from gitlab.base import RESTManager, RESTObject from gitlab.mixins import GetWithoutIdMixin, RefreshMixin __all__ = [ + "GroupIssuesStatistics", + "GroupIssuesStatisticsManager", "ProjectAdditionalStatistics", "ProjectAdditionalStatisticsManager", + "IssuesStatistics", + "IssuesStatisticsManager", "ProjectIssuesStatistics", "ProjectIssuesStatisticsManager", ] @@ -19,6 +23,25 @@ class ProjectAdditionalStatisticsManager(GetWithoutIdMixin, RESTManager): _from_parent_attrs = {"project_id": "id"} +class IssuesStatistics(RefreshMixin, RESTObject): + _id_attr = None + + +class IssuesStatisticsManager(GetWithoutIdMixin, RESTManager): + _path = "/issues_statistics" + _obj_cls = IssuesStatistics + + +class GroupIssuesStatistics(RefreshMixin, RESTObject): + _id_attr = None + + +class GroupIssuesStatisticsManager(GetWithoutIdMixin, RESTManager): + _path = "/groups/%(group_id)s/issues_statistics" + _obj_cls = GroupIssuesStatistics + _from_parent_attrs = {"group_id": "id"} + + class ProjectIssuesStatistics(RefreshMixin, RESTObject): _id_attr = None |