Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions gitlab/v4/objects/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
"GroupDescendantGroupManager",
"GroupSubgroup",
"GroupSubgroupManager",
"GroupLdapLinks",
"GroupLdapLinksManager",
Comment on lines +41 to +42
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with other objects, we should use the single (the API also supports adding a single link)

Suggested change
"GroupLdapLinks",
"GroupLdapLinksManager",
"GroupLdapLink",
"GroupLdapLinkManager",

]


Expand Down Expand Up @@ -71,6 +73,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject):
subgroups: "GroupSubgroupManager"
variables: GroupVariableManager
wikis: GroupWikiManager
ldap_group_links: "GroupLdapLinksManager"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ldap_group_links: "GroupLdapLinksManager"
ldap_group_links: "GroupLdapLinkManager"


@cli.register_custom_action("Group", ("project_id",))
@exc.on_http_error(exc.GitlabTransferProjectError)
Expand Down Expand Up @@ -320,6 +323,16 @@ class GroupSubgroupManager(ListMixin, RESTManager):
_types = {"skip_groups": types.ListAttribute}


class GroupLdapLinks(RESTObject):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class GroupLdapLinks(RESTObject):
class GroupLdapLink(RESTObject):

pass


class GroupLdapLinksManager(ListMixin, RESTManager):
_path = "/groups/%(group_id)s/ldap_group_links"
_obj_cls = GroupLdapLinks
Comment on lines +330 to +332
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class GroupLdapLinksManager(ListMixin, RESTManager):
_path = "/groups/%(group_id)s/ldap_group_links"
_obj_cls = GroupLdapLinks
class GroupLdapLinkManager(ListMixin, RESTManager):
_path = "/groups/%(group_id)s/ldap_group_links"
_obj_cls = GroupLdapLink

_from_parent_attrs = {"group_id": "id"}


class GroupDescendantGroup(RESTObject):
pass

Expand Down