summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects/groups.py
diff options
context:
space:
mode:
authorAbhishek Singh <abhiandthetruth@gmail.com>2022-11-22 04:44:47 +0530
committerGitHub <noreply@github.com>2022-11-22 00:14:47 +0100
commit1020ce965ff0cd3bfc283d4f0ad40e41e4d1bcee (patch)
tree1e3be865297737f5b147d26ec3a05ae6ef8d19d7 /gitlab/v4/objects/groups.py
parent65abb85be7fc8ef57b295296111dac0a97ed1c49 (diff)
downloadgitlab-1020ce965ff0cd3bfc283d4f0ad40e41e4d1bcee.tar.gz
feat: add support for SAML group links (#2367)
Diffstat (limited to 'gitlab/v4/objects/groups.py')
-rw-r--r--gitlab/v4/objects/groups.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/gitlab/v4/objects/groups.py b/gitlab/v4/objects/groups.py
index 4111496..d03eb38 100644
--- a/gitlab/v4/objects/groups.py
+++ b/gitlab/v4/objects/groups.py
@@ -12,6 +12,7 @@ from gitlab.mixins import (
CRUDMixin,
DeleteMixin,
ListMixin,
+ NoUpdateMixin,
ObjectDeleteMixin,
SaveMixin,
)
@@ -58,6 +59,8 @@ __all__ = [
"GroupLDAPGroupLinkManager",
"GroupSubgroup",
"GroupSubgroupManager",
+ "GroupSAMLGroupLink",
+ "GroupSAMLGroupLinkManager",
]
@@ -98,6 +101,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject):
subgroups: "GroupSubgroupManager"
variables: GroupVariableManager
wikis: GroupWikiManager
+ saml_group_links: "GroupSAMLGroupLinkManager"
@cli.register_custom_action("Group", ("project_id",))
@exc.on_http_error(exc.GitlabTransferProjectError)
@@ -464,3 +468,20 @@ class GroupLDAPGroupLinkManager(ListMixin, CreateMixin, DeleteMixin, RESTManager
_create_attrs = RequiredOptional(
required=("provider", "group_access"), exclusive=("cn", "filter")
)
+
+
+class GroupSAMLGroupLink(ObjectDeleteMixin, RESTObject):
+ _id_attr = "name"
+ _repr_attr = "name"
+
+
+class GroupSAMLGroupLinkManager(NoUpdateMixin, RESTManager):
+ _path = "/groups/{group_id}/saml_group_links"
+ _obj_cls: Type[GroupSAMLGroupLink] = GroupSAMLGroupLink
+ _from_parent_attrs = {"group_id": "id"}
+ _create_attrs = RequiredOptional(required=("saml_group_name", "access_level"))
+
+ def get(
+ self, id: Union[str, int], lazy: bool = False, **kwargs: Any
+ ) -> GroupSAMLGroupLink:
+ return cast(GroupSAMLGroupLink, super().get(id=id, lazy=lazy, **kwargs))