mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-02-01 13:07:50 +02:00
Renamed Board methods according their API names
This commit is contained in:
parent
e6dd745ae7
commit
4ef9c13c74
14
board.go
14
board.go
@ -41,10 +41,10 @@ type BoardListOptions struct {
|
||||
SearchOptions
|
||||
}
|
||||
|
||||
// GetList will return all boards from JIRA
|
||||
// GetAllBoards will returns all boards. This only includes boards that the user has permission to view.
|
||||
//
|
||||
// JIRA API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-getAllBoards
|
||||
func (s *BoardService) GetList(opt *BoardListOptions) (*BoardsList, *Response, error) {
|
||||
func (s *BoardService) GetAllBoards(opt *BoardListOptions) (*BoardsList, *Response, error) {
|
||||
apiEndpoint := "rest/agile/1.0/board"
|
||||
url, err := addOptions(apiEndpoint, opt)
|
||||
req, err := s.client.NewRequest("GET", url, nil)
|
||||
@ -61,11 +61,11 @@ func (s *BoardService) GetList(opt *BoardListOptions) (*BoardsList, *Response, e
|
||||
return boards, resp, err
|
||||
}
|
||||
|
||||
// Get will return the board for the given boardID.
|
||||
// GetBoard will returns the board for the given boardID.
|
||||
// This board will only be returned if the user has permission to view it.
|
||||
//
|
||||
// JIRA API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-getBoard
|
||||
func (s *BoardService) Get(boardID int) (*Board, *Response, error) {
|
||||
func (s *BoardService) GetBoard(boardID int) (*Board, *Response, error) {
|
||||
apiEndpoint := fmt.Sprintf("rest/agile/1.0/board/%v", boardID)
|
||||
req, err := s.client.NewRequest("GET", apiEndpoint, nil)
|
||||
if err != nil {
|
||||
@ -88,7 +88,7 @@ func (s *BoardService) Get(boardID int) (*Board, *Response, error) {
|
||||
// board will be created instead (remember that board sharing depends on the filter sharing).
|
||||
//
|
||||
// JIRA API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-createBoard
|
||||
func (s *BoardService) Create(board *Board) (*Board, *Response, error) {
|
||||
func (s *BoardService) CreateBoard(board *Board) (*Board, *Response, error) {
|
||||
apiEndpoint := "rest/agile/1.0/board"
|
||||
req, err := s.client.NewRequest("POST", apiEndpoint, board)
|
||||
if err != nil {
|
||||
@ -106,8 +106,8 @@ func (s *BoardService) Create(board *Board) (*Board, *Response, error) {
|
||||
|
||||
// Delete will delete an agile board.
|
||||
//
|
||||
// https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-deleteBoard
|
||||
func (s *BoardService) Delete(boardID int) (*Board, *Response, error) {
|
||||
// JIRA API docs: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board-deleteBoard
|
||||
func (s *BoardService) DeleteBoard(boardID int) (*Board, *Response, error) {
|
||||
apiEndpoint := fmt.Sprintf("rest/agile/1.0/board/%v", boardID)
|
||||
req, err := s.client.NewRequest("DELETE", apiEndpoint, nil)
|
||||
if err != nil {
|
||||
|
@ -22,7 +22,7 @@ func TestBoardsGetAll(t *testing.T) {
|
||||
fmt.Fprint(w, string(raw))
|
||||
})
|
||||
|
||||
projects, _, err := testClient.Board.GetList(nil)
|
||||
projects, _, err := testClient.Board.GetAllBoards(nil)
|
||||
if projects == nil {
|
||||
t.Error("Expected boards list. Boards list is nil")
|
||||
}
|
||||
@ -55,7 +55,7 @@ func TestBoardsGetFiltered(t *testing.T) {
|
||||
boardsListOptions.StartAt = 1
|
||||
boardsListOptions.MaxResults = 10
|
||||
|
||||
projects, _, err := testClient.Board.GetList(boardsListOptions)
|
||||
projects, _, err := testClient.Board.GetAllBoards(boardsListOptions)
|
||||
if projects == nil {
|
||||
t.Error("Expected boards list. Boards list is nil")
|
||||
}
|
||||
@ -75,7 +75,7 @@ func TestBoardGet(t *testing.T) {
|
||||
fmt.Fprint(w, `{"id":4,"self":"https://test.jira.org/rest/agile/1.0/board/1","name":"Test Weekly","type":"scrum"}`)
|
||||
})
|
||||
|
||||
board, _, err := testClient.Board.Get(1)
|
||||
board, _, err := testClient.Board.GetBoard(1)
|
||||
if board == nil {
|
||||
t.Error("Expected board list. Board list is nil")
|
||||
}
|
||||
@ -95,7 +95,7 @@ func TestBoardGet_NoBoard(t *testing.T) {
|
||||
fmt.Fprint(w, nil)
|
||||
})
|
||||
|
||||
board, resp, err := testClient.Board.Get(99999999)
|
||||
board, resp, err := testClient.Board.GetBoard(99999999)
|
||||
if board != nil {
|
||||
t.Errorf("Expected nil. Got %s", err)
|
||||
}
|
||||
@ -124,7 +124,7 @@ func TestBoardCreate(t *testing.T) {
|
||||
Type: "kanban",
|
||||
FilterID: 17,
|
||||
}
|
||||
issue, _, err := testClient.Board.Create(b)
|
||||
issue, _, err := testClient.Board.CreateBoard(b)
|
||||
if issue == nil {
|
||||
t.Error("Expected board. Board is nil")
|
||||
}
|
||||
@ -144,7 +144,7 @@ func TestBoardDelete(t *testing.T) {
|
||||
fmt.Fprint(w, `{}`)
|
||||
})
|
||||
|
||||
_, resp, err := testClient.Board.Delete(1)
|
||||
_, resp, err := testClient.Board.DeleteBoard(1)
|
||||
if resp.StatusCode != 204 {
|
||||
t.Error("Expected board not deleted.")
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user