Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add group.shared_with_groups.list() #2813

Closed
TimKnight-DWP opened this issue Feb 29, 2024 · 2 comments
Closed

Add group.shared_with_groups.list() #2813

TimKnight-DWP opened this issue Feb 29, 2024 · 2 comments
Labels

Comments

@TimKnight-DWP
Copy link
Contributor

Description of the problem, including code/CLI snippet

Groups have a share/unshare functionality defined on the api, but no get for the shared_with_groups parameter defined in gitlab api groups/:id

Expected Behavior

group.shared_with_groups.list() should return an array of groups a group has been shared with

 "shared_with_groups": [
    {
      "group_id": 28,
      "group_name": "H5bp",
      "group_full_path": "h5bp",
      "group_access_level": 20,
      "expires_at": null
    }
  ],

Actual Behavior

No such api is available

Specifications

  • python-gitlab version: 4.4.0
  • API version you are using (v3/v4): v4
  • Gitlab server version (or gitlab.com): gitlab.com
@nejch nejch added the support label Feb 29, 2024
@nejch
Copy link
Member

nejch commented Feb 29, 2024

@TimKnight-DWP to my knowledge shared_with_groups is an attribute returned by the single group GET call, not an additional nested endpoint. So you should be able to just do:

group = gl.groups.get(123)
print(group.shared_with_groups) # [] or [{"id": 124,...}]

At least that's how I've been using it at work for a while.

@TimKnight-DWP
Copy link
Contributor Author

@nejch perfect, I couldn't see any docs or closed issues/discussions on it but had assumed it must be somewhere on the api since GL returns it.

I'll implement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants