APIv4 get /channels/{channel_id}/pinned (#5893)

Этот коммит содержится в:
Saturnino Abril
2017-03-30 00:09:05 +09:00
коммит произвёл Corey Hulen
родитель 64f80decaf
Коммит 8a31718db1
5 изменённых файлов: 102 добавлений и 0 удалений

Просмотреть файл

@@ -1004,6 +1004,16 @@ func (c *Client4) GetChannelStats(channelId string, etag string) (*ChannelStats,
}
}
// GetPinnedPosts gets a list of pinned posts.
func (c *Client4) GetPinnedPosts(channelId string, etag string) (*PostList, *Response) {
if r, err := c.DoApiGet(c.GetChannelRoute(channelId)+"/pinned", etag); err != nil {
return nil, &Response{StatusCode: r.StatusCode, Error: err}
} else {
defer closeBody(r)
return PostListFromJson(r.Body), BuildResponse(r)
}
}
// GetPublicChannelsForTeam returns a list of public channels based on the provided team id string.
func (c *Client4) GetPublicChannelsForTeam(teamId string, page int, perPage int, etag string) (*ChannelList, *Response) {
query := fmt.Sprintf("?page=%v&per_page=%v", page, perPage)