Skip to content

Commit

Permalink
Merge pull request #768 from paulvollmer/master
Browse files Browse the repository at this point in the history
Added CreateGroupIssueBoard func #767
  • Loading branch information
svanharmelen committed Feb 6, 2020
2 parents 90dd5e8 + a929d94 commit 7bb993b
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions group_boards.go
Expand Up @@ -77,6 +77,40 @@ func (s *GroupIssueBoardsService) ListGroupIssueBoards(gid interface{}, opt *Lis
return gs, resp, err
}

// CreateGroupIssueBoardOptions represents the available
// CreateGroupIssueBoard() options.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/group_boards.html#create-a-group-issue-board-premium
type CreateGroupIssueBoardOptions struct {
Name *string `url:"name" json:"name"`
}

// CreateGroupIssueBoard creates a new issue board.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/group_boards.html#create-a-group-issue-board-premium
func (s *GroupIssueBoardsService) CreateGroupIssueBoard(gid interface{}, opt *CreateGroupIssueBoardOptions, options ...OptionFunc) (*GroupIssueBoard, *Response, error) {
group, err := parseID(gid)
if err != nil {
return nil, nil, err
}
u := fmt.Sprintf("groups/%s/boards", pathEscape(group))

req, err := s.client.NewRequest("POST", u, opt, options)
if err != nil {
return nil, nil, err
}

gib := new(GroupIssueBoard)
resp, err := s.client.Do(req, gib)
if err != nil {
return nil, resp, err
}

return gib, resp, err
}

// GetGroupIssueBoard gets a single issue board of a group.
//
// GitLab API docs:
Expand Down

0 comments on commit 7bb993b

Please sign in to comment.