diff options
Diffstat (limited to 'vendor/github.com/xanzy/go-gitlab/group_boards.go')
-rw-r--r-- | vendor/github.com/xanzy/go-gitlab/group_boards.go | 104 |
1 files changed, 97 insertions, 7 deletions
diff --git a/vendor/github.com/xanzy/go-gitlab/group_boards.go b/vendor/github.com/xanzy/go-gitlab/group_boards.go index 1e814c57f7..d9d2ee6d41 100644 --- a/vendor/github.com/xanzy/go-gitlab/group_boards.go +++ b/vendor/github.com/xanzy/go-gitlab/group_boards.go @@ -56,7 +56,7 @@ type ListGroupIssueBoardsOptions ListOptions // // GitLab API docs: // https://docs.gitlab.com/ce/api/group_boards.html#group-board -func (s *GroupIssueBoardsService) ListGroupIssueBoards(gid interface{}, opt *ListGroupIssueBoardsOptions, options ...OptionFunc) ([]*GroupIssueBoard, *Response, error) { +func (s *GroupIssueBoardsService) ListGroupIssueBoards(gid interface{}, opt *ListGroupIssueBoardsOptions, options ...RequestOptionFunc) ([]*GroupIssueBoard, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -77,11 +77,45 @@ 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 ...RequestOptionFunc) (*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: // https://docs.gitlab.com/ce/api/group_boards.html#single-board -func (s *GroupIssueBoardsService) GetGroupIssueBoard(gid interface{}, board int, options ...OptionFunc) (*GroupIssueBoard, *Response, error) { +func (s *GroupIssueBoardsService) GetGroupIssueBoard(gid interface{}, board int, options ...RequestOptionFunc) (*GroupIssueBoard, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -102,6 +136,62 @@ func (s *GroupIssueBoardsService) GetGroupIssueBoard(gid interface{}, board int, return gib, resp, err } +// UpdateGroupIssueBoardOptions represents a group issue board. +// +// GitLab API docs: +// https://docs.gitlab.com/ce/api/group_boards.html#update-a-group-issue-board-premium +type UpdateGroupIssueBoardOptions struct { + Name *string `url:"name,omitempty" json:"name,omitempty"` + AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` + MilestoneID *int `url:"milestone_id,omitempty" json:"milestone_id,omitempty"` + Labels *Labels `url:"labels,omitempty" json:"labels,omitempty"` + Weight *int `url:"weight,omitempty" json:"weight,omitempty"` +} + +// UpdateIssueBoard updates a single issue board of a group. +// +// GitLab API docs: +// https://docs.gitlab.com/ce/api/group_boards.html#update-a-group-issue-board-premium +func (s *GroupIssueBoardsService) UpdateIssueBoard(gid interface{}, board int, opt *UpdateGroupIssueBoardOptions, options ...RequestOptionFunc) (*GroupIssueBoard, *Response, error) { + group, err := parseID(gid) + if err != nil { + return nil, nil, err + } + u := fmt.Sprintf("groups/%s/boards/%d", pathEscape(group), board) + + req, err := s.client.NewRequest("PUT", 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 +} + +// DeleteIssueBoard delete a single issue board of a group. +// +// GitLab API docs: +// https://docs.gitlab.com/ce/api/group_boards.html#delete-a-group-issue-board-premium +func (s *GroupIssueBoardsService) DeleteIssueBoard(gid interface{}, board int, options ...RequestOptionFunc) (*Response, error) { + group, err := parseID(gid) + if err != nil { + return nil, err + } + u := fmt.Sprintf("groups/%s/boards/%d", pathEscape(group), board) + + req, err := s.client.NewRequest("DELETE", u, nil, options) + if err != nil { + return nil, err + } + + return s.client.Do(req, nil) +} + // ListGroupIssueBoardListsOptions represents the available // ListGroupIssueBoardLists() options. // @@ -113,7 +203,7 @@ type ListGroupIssueBoardListsOptions ListOptions // backlog and closed lists. // // GitLab API docs: https://docs.gitlab.com/ce/api/group_boards.html#list-board-lists -func (s *GroupIssueBoardsService) ListGroupIssueBoardLists(gid interface{}, board int, opt *ListGroupIssueBoardListsOptions, options ...OptionFunc) ([]*BoardList, *Response, error) { +func (s *GroupIssueBoardsService) ListGroupIssueBoardLists(gid interface{}, board int, opt *ListGroupIssueBoardListsOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -138,7 +228,7 @@ func (s *GroupIssueBoardsService) ListGroupIssueBoardLists(gid interface{}, boar // // GitLab API docs: // https://docs.gitlab.com/ce/api/group_boards.html#single-board-list -func (s *GroupIssueBoardsService) GetGroupIssueBoardList(gid interface{}, board, list int, options ...OptionFunc) (*BoardList, *Response, error) { +func (s *GroupIssueBoardsService) GetGroupIssueBoardList(gid interface{}, board, list int, options ...RequestOptionFunc) (*BoardList, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -176,7 +266,7 @@ type CreateGroupIssueBoardListOptions struct { // // GitLab API docs: // https://docs.gitlab.com/ce/api/group_boards.html#new-board-list -func (s *GroupIssueBoardsService) CreateGroupIssueBoardList(gid interface{}, board int, opt *CreateGroupIssueBoardListOptions, options ...OptionFunc) (*BoardList, *Response, error) { +func (s *GroupIssueBoardsService) CreateGroupIssueBoardList(gid interface{}, board int, opt *CreateGroupIssueBoardListOptions, options ...RequestOptionFunc) (*BoardList, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -211,7 +301,7 @@ type UpdateGroupIssueBoardListOptions struct { // // GitLab API docs: // https://docs.gitlab.com/ce/api/group_boards.html#edit-board-list -func (s *GroupIssueBoardsService) UpdateIssueBoardList(gid interface{}, board, list int, opt *UpdateGroupIssueBoardListOptions, options ...OptionFunc) ([]*BoardList, *Response, error) { +func (s *GroupIssueBoardsService) UpdateIssueBoardList(gid interface{}, board, list int, opt *UpdateGroupIssueBoardListOptions, options ...RequestOptionFunc) ([]*BoardList, *Response, error) { group, err := parseID(gid) if err != nil { return nil, nil, err @@ -241,7 +331,7 @@ func (s *GroupIssueBoardsService) UpdateIssueBoardList(gid interface{}, board, l // // GitLab API docs: // https://docs.gitlab.com/ce/api/group_boards.html#delete-a-board-list -func (s *GroupIssueBoardsService) DeleteGroupIssueBoardList(gid interface{}, board, list int, options ...OptionFunc) (*Response, error) { +func (s *GroupIssueBoardsService) DeleteGroupIssueBoardList(gid interface{}, board, list int, options ...RequestOptionFunc) (*Response, error) { group, err := parseID(gid) if err != nil { return nil, err |