APIv4 DELETE channels/{channel_id} (#5723)

Этот коммит содержится в:
Saturnino Abril
2017-03-14 21:08:58 +09:00
коммит произвёл George Goldberg
родитель aafc63933a
Коммит a71a9fc3bf
6 изменённых файлов: 337 добавлений и 0 удалений

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

@@ -841,6 +841,16 @@ func (c *Client4) GetPublicChannelsForTeam(teamId string, page int, perPage int,
}
}
// DeleteChannel deletes channel based on the provided channel id string.
func (c *Client4) DeleteChannel(channelId string) (bool, *Response) {
if r, err := c.DoApiDelete(c.GetChannelRoute(channelId)); err != nil {
return false, &Response{StatusCode: r.StatusCode, Error: err}
} else {
defer closeBody(r)
return CheckStatusOK(r), BuildResponse(r)
}
}
// GetChannelByName returns a channel based on the provided channel name and team id strings.
func (c *Client4) GetChannelByName(channelName, teamId string, etag string) (*Channel, *Response) {
if r, err := c.DoApiGet(c.GetChannelByNameRoute(channelName, teamId), etag); err != nil {