// GetCurrentUserBoards gets current user's boards by Teams ID.
//
// API doc: https://developers.miro.com/reference#get-team-boards
GetCurrentUserBoards gets current user's boards by Teams ID.


// GetCurrentUserBoards gets current user ' s boards by Teams ID . // // API doc : https : // developers . miro . com / reference#get - team - boards
func (s *BoardsService) GetCurrentUserBoards(ctx context.Context, teamID string) (*ListBoardsResponse, error) {
	req, err := s.client.NewGetRequest(fmt.Sprintf("%s/%s/boards", teamsPath, teamID))
	if err != nil {
		return nil, err
	}
	resp, err := s.client.Do(ctx, req)
	if err != nil {
		respErr := &RespError{}
		if err := json.NewDecoder(resp.Body).Decode(respErr); err != nil {
			return nil, err
		}
		return nil, respErr
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusNoContent {
		respErr := &RespError{}
		if err := json.NewDecoder(resp.Body).Decode(respErr); err != nil {
			return nil, err
		}
		return nil, fmt.Errorf("status code not expected, got:%d, message:%s", resp.StatusCode, respErr.Message)
	}
	boardList := &ListBoardsResponse{}
	if err := json.NewDecoder(resp.Body).Decode(boardList); err != nil {
		return nil, err
	}
	return boardList, nil
}
func ( s * BoardsService ) GetCurrentUserBoards ( ctx context . Context , teamID string ) ( * ListBoardsResponse , error ) { req , err := s . client . NewGetRequest ( fmt . Sprintf ( " " , teamsPath , teamID ) ) if err != nil { return nil , err } resp , err := s . client . Do ( ctx , req ) if err != nil { respErr := & RespError { } if err := json . NewDecoder ( resp . Body ) . Decode ( respErr ) ; err != nil { return nil , err } return nil , respErr } defer resp . Body . Close ( ) if resp . StatusCode != http . StatusNoContent { respErr := & RespError { } if err := json . NewDecoder ( resp . Body ) . Decode ( respErr ) ; err != nil { return nil , err } return nil , fmt . Errorf ( " " , resp . StatusCode , respErr . Message ) } boardList := & ListBoardsResponse { } if err := json . NewDecoder ( resp . Body ) . Decode ( boardList ) ; err != nil { return nil , err } return boardList , nil }
GetCurrentUserBoards gets current user's boards by Teams ID.
GetCurrentUserBoards gets current user ' s boards by Teams ID .