From d8de4dc373dc608be6cf6ba14a2acc7efd3fa7a7 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Sun, 13 Jun 2021 14:40:46 -0700 Subject: chore: convert to using type-annotations for managers Convert our manager usage to be done via type annotations. Now to define a manager to be used in a RESTObject subclass can simply do: class ExampleClass(CRUDMixin, RESTObject): my_manager: MyManager Any type-annotation that annotates it to be of type *Manager (with the exception of RESTManager) will cause the manager to be created on the object. --- gitlab/v4/objects/groups.py | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'gitlab/v4/objects/groups.py') diff --git a/gitlab/v4/objects/groups.py b/gitlab/v4/objects/groups.py index 67fe91c..7de4f84 100644 --- a/gitlab/v4/objects/groups.py +++ b/gitlab/v4/objects/groups.py @@ -71,35 +71,6 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject): subgroups: "GroupSubgroupManager" variables: GroupVariableManager wikis: GroupWikiManager - _managers = ( - ("accessrequests", "GroupAccessRequestManager"), - ("audit_events", "GroupAuditEventManager"), - ("badges", "GroupBadgeManager"), - ("billable_members", "GroupBillableMemberManager"), - ("boards", "GroupBoardManager"), - ("customattributes", "GroupCustomAttributeManager"), - ("descendant_groups", "GroupDescendantGroupManager"), - ("exports", "GroupExportManager"), - ("epics", "GroupEpicManager"), - ("hooks", "GroupHookManager"), - ("imports", "GroupImportManager"), - ("issues", "GroupIssueManager"), - ("issues_statistics", "GroupIssuesStatisticsManager"), - ("labels", "GroupLabelManager"), - ("members", "GroupMemberManager"), - ("members_all", "GroupMemberAllManager"), - ("mergerequests", "GroupMergeRequestManager"), - ("milestones", "GroupMilestoneManager"), - ("notificationsettings", "GroupNotificationSettingsManager"), - ("packages", "GroupPackageManager"), - ("projects", "GroupProjectManager"), - ("runners", "GroupRunnerManager"), - ("subgroups", "GroupSubgroupManager"), - ("variables", "GroupVariableManager"), - ("clusters", "GroupClusterManager"), - ("deploytokens", "GroupDeployTokenManager"), - ("wikis", "GroupWikiManager"), - ) @cli.register_custom_action("Group", ("to_project_id",)) @exc.on_http_error(exc.GitlabTransferProjectError) -- cgit v1.2.1