Skip to content

Commit

Permalink
Tweak PR just a little...
Browse files Browse the repository at this point in the history
  • Loading branch information
svanharmelen committed Aug 21, 2022
1 parent 301e201 commit 88c4146
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions groups.go
Expand Up @@ -105,8 +105,8 @@ type LDAPGroupLink struct {
//
// GitLab API docs: https://docs.gitlab.com/ce/api/groups.html#saml-group-links
type SAMLGroupLink struct {
AccessLevel string `json:"access_level"`
Name string `json:"name"`
AccessLevel string `json:"access_level"`
}

// ListGroupsOptions represents the available ListGroups() options.
Expand Down Expand Up @@ -770,26 +770,26 @@ func (s *GroupsService) ListGroupSAMLLinks(gid interface{}, options ...RequestOp
return nil, nil, err
}

var gls []*SAMLGroupLink
resp, err := s.client.Do(req, &gls)
var gl []*SAMLGroupLink
resp, err := s.client.Do(req, &gl)
if err != nil {
return nil, resp, err
}

return gls, resp, nil
return gl, resp, nil
}

// GetGroupSAMLLink get a specific group SAML link. Available only for users who
// can edit groups.
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/groups.html#get-saml-group-link
func (s *GroupsService) GetGroupSAMLLink(gid interface{}, saml_group_name string, options ...RequestOptionFunc) (*SAMLGroupLink, *Response, error) {
func (s *GroupsService) GetGroupSAMLLink(gid interface{}, samlGroupName string, options ...RequestOptionFunc) (*SAMLGroupLink, *Response, error) {
group, err := parseID(gid)
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("groups/%s/saml_group_links/%s", PathEscape(group), PathEscape(saml_group_name))
u := fmt.Sprintf("groups/%s/saml_group_links/%s", PathEscape(group), PathEscape(samlGroupName))

req, err := s.client.NewRequest(http.MethodGet, u, nil, options)
if err != nil {
Expand All @@ -810,8 +810,8 @@ func (s *GroupsService) GetGroupSAMLLink(gid interface{}, saml_group_name string
// GitLab API docs:
// https://docs.gitlab.com/ee/api/groups.html#add-saml-group-link
type AddGroupSAMLLinkOptions struct {
SAMLGroupName *string `url:"saml_group_name,omitempty" json:"saml_group_name,omitempty"`
AccessLevel *string `url:"access_level,omitempty" json:"access_level,omitempty"`
SamlGroupName *string `url:"saml_group_name,omitempty" json:"saml_group_name,omitempty"`
}

// AddGroupSAMLLink creates a new group SAML link. Available only for users who
Expand Down Expand Up @@ -845,12 +845,12 @@ func (s *GroupsService) AddGroupSAMLLink(gid interface{}, opt *AddGroupSAMLLinkO
//
// GitLab API docs:
// https://docs.gitlab.com/ee/api/groups.html#delete-saml-group-link
func (s *GroupsService) DeleteGroupSAMLLink(gid interface{}, saml_group_name string, options ...RequestOptionFunc) (*Response, error) {
func (s *GroupsService) DeleteGroupSAMLLink(gid interface{}, samlGroupName string, options ...RequestOptionFunc) (*Response, error) {
group, err := parseID(gid)
if err != nil {
return nil, err
}
u := fmt.Sprintf("groups/%s/saml_group_links/%s", PathEscape(group), PathEscape(saml_group_name))
u := fmt.Sprintf("groups/%s/saml_group_links/%s", PathEscape(group), PathEscape(samlGroupName))

req, err := s.client.NewRequest(http.MethodDelete, u, nil, options)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion groups_test.go
Expand Up @@ -446,8 +446,8 @@ func TestAddGroupSAMLLink(t *testing.T) {
})

opt := &AddGroupSAMLLinkOptions{
SAMLGroupName: String("gitlab_group_example_developer"),
AccessLevel: String("Developer"),
SamlGroupName: String("gitlab_group_example_developer"),
}

link, _, err := client.Groups.AddGroupSAMLLink(1, opt)
Expand Down

0 comments on commit 88c4146

Please sign in to comment.