summaryrefslogtreecommitdiff
path: root/gitlab
diff options
context:
space:
mode:
authorNejc Habjan <nejc.habjan@siemens.com>2022-07-24 22:32:31 +0200
committerJohn Villalovos <john@sodarock.com>2022-07-26 22:41:59 -0700
commit66461ba519a85bfbd3cba284a0c8de11a3ac7cde (patch)
tree853f37fb1ca26aea5339f82b9c578469d1fde401 /gitlab
parent8d4f13b192afd5d4610eeaf2bbea71c3b6a25964 (diff)
downloadgitlab-66461ba519a85bfbd3cba284a0c8de11a3ac7cde.tar.gz
feat(groups): add support for shared projects API
Diffstat (limited to 'gitlab')
-rw-r--r--gitlab/v4/objects/groups.py3
-rw-r--r--gitlab/v4/objects/projects.py25
2 files changed, 27 insertions, 1 deletions
diff --git a/gitlab/v4/objects/groups.py b/gitlab/v4/objects/groups.py
index 45a4dad..5b35e00 100644
--- a/gitlab/v4/objects/groups.py
+++ b/gitlab/v4/objects/groups.py
@@ -34,7 +34,7 @@ from .merge_requests import GroupMergeRequestManager # noqa: F401
from .milestones import GroupMilestoneManager # noqa: F401
from .notification_settings import GroupNotificationSettingsManager # noqa: F401
from .packages import GroupPackageManager # noqa: F401
-from .projects import GroupProjectManager # noqa: F401
+from .projects import GroupProjectManager, SharedProjectManager # noqa: F401
from .push_rules import GroupPushRulesManager
from .runners import GroupRunnerManager # noqa: F401
from .statistics import GroupIssuesStatisticsManager # noqa: F401
@@ -79,6 +79,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject):
notificationsettings: GroupNotificationSettingsManager
packages: GroupPackageManager
projects: GroupProjectManager
+ shared_projects: SharedProjectManager
pushrules: GroupPushRulesManager
registry_repositories: GroupRegistryRepositoryManager
runners: GroupRunnerManager
diff --git a/gitlab/v4/objects/projects.py b/gitlab/v4/objects/projects.py
index b008dda..e46e53d 100644
--- a/gitlab/v4/objects/projects.py
+++ b/gitlab/v4/objects/projects.py
@@ -103,6 +103,8 @@ __all__ = [
"ProjectRemoteMirrorManager",
"ProjectStorage",
"ProjectStorageManager",
+ "SharedProject",
+ "SharedProjectManager",
]
@@ -1081,3 +1083,26 @@ class ProjectStorageManager(GetWithoutIdMixin, RESTManager):
def get(self, **kwargs: Any) -> ProjectStorage:
return cast(ProjectStorage, super().get(**kwargs))
+
+
+class SharedProject(RESTObject):
+ pass
+
+
+class SharedProjectManager(ListMixin, RESTManager):
+ _path = "/groups/{group_id}/projects/shared"
+ _obj_cls = SharedProject
+ _from_parent_attrs = {"group_id": "id"}
+ _list_filters = (
+ "archived",
+ "visibility",
+ "order_by",
+ "sort",
+ "search",
+ "simple",
+ "starred",
+ "with_issues_enabled",
+ "with_merge_requests_enabled",
+ "min_access_level",
+ "with_custom_attributes",
+ )