Add endpoint to lists invited groups of a project#2000
Add endpoint to lists invited groups of a project#2000svanharmelen merged 2 commits intoxanzy:mainfrom
Conversation
svanharmelen
left a comment
There was a problem hiding this comment.
Thanks @habnux, but it seems you missed a few bits. I've made some comments but will also add a commit with the fixes so this one can be merged 👍🏻
projects.go
Outdated
| type ListProjectInvidedGroupOptions struct { | ||
| ListOptions | ||
| Search *string `url:"search,omitempty" json:"search,omitempty"` | ||
| SharedMinAccessLevel *AccessLevelValue `url:"shared_min_access_level,omitempty" json:"shared_min_access_level,omitempty"` |
There was a problem hiding this comment.
According to the docs this should be MinAccessLevel (min_access_level).
projects.go
Outdated
| // ListProjectInvidedGroupOptions represents the available ListProjectsInvitedGroups() options. | ||
| // | ||
| // GitLab API docs: https://docs.gitlab.com/ee/api/projects.html#list-a-projects-invited-groups |
There was a problem hiding this comment.
Please try to keep comments below 80 chars:
| // ListProjectInvidedGroupOptions represents the available ListProjectsInvitedGroups() options. | |
| // | |
| // GitLab API docs: https://docs.gitlab.com/ee/api/projects.html#list-a-projects-invited-groups | |
| // ListProjectInvidedGroupOptions represents the available | |
| // ListProjectsInvitedGroups() options. | |
| // | |
| // GitLab API docs: | |
| // https://docs.gitlab.com/ee/api/projects.html#list-a-projects-invited-groups |
projects.go
Outdated
| Relation []string `url:"relation,omitempty" json:"relation,omitempty"` | ||
| WithCustomAttributes bool `url:"with_custom_attributes,omitempty" json:"with_custom_attributes,omitempty"` |
There was a problem hiding this comment.
These need to be pointers and it seems this code is not formatted properly:
| Relation []string `url:"relation,omitempty" json:"relation,omitempty"` | |
| WithCustomAttributes bool `url:"with_custom_attributes,omitempty" json:"with_custom_attributes,omitempty"` | |
| Relation *[]string `url:"relation,omitempty" json:"relation,omitempty"` | |
| WithCustomAttributes *bool `url:"with_custom_attributes,omitempty" json:"with_custom_attributes,omitempty"` |
projects.go
Outdated
| // ListProjectsInvitedGroups lists invited groups of a project | ||
| // | ||
| // GitLab API docs: https://docs.gitlab.com/ee/api/projects.html#list-a-projects-invited-groups | ||
| func (s *ProjectsService) ListProjectsInvitedGroups(pid interface{}, opt *ListProjectInvidedGroupOptions, options ...RequestOptionFunc) (*Response, error) { |
There was a problem hiding this comment.
This function should also return a *ProjectGroup instead of only the raw response.
projects.go
Outdated
| } | ||
|
|
||
| return s.client.Do(req, nil) | ||
| } |
There was a problem hiding this comment.
Following the ordering in the docs, this method should be placed between Star and Unstar.
projects_test.go
Outdated
| } | ||
| } | ||
|
|
||
| func TestListProjectsInvitedGroups(t *testing.T) { |
There was a problem hiding this comment.
A test like this doesn't actually test anything, so probably best to remove it.
Adds following endoint https://docs.gitlab.com/ee/api/projects.html#list-a-projects-invited-groups