PLT-6019: Add APIv4 Endpoint for restoring Channels (#6263)

Этот коммит содержится в:
Robin Naundorf
2017-05-15 22:12:30 +02:00
коммит произвёл Joram Wilander
родитель 34728f748b
Коммит 0a20e8d326
7 изменённых файлов: 108 добавлений и 0 удалений

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

@@ -1217,6 +1217,16 @@ func (c *Client4) PatchChannel(channelId string, patch *ChannelPatch) (*Channel,
}
}
// RestoreChannel restores a previously deleted channel. Any missing fields are not updated.
func (c *Client4) RestoreChannel(channelId string) (*Channel, *Response) {
if r, err := c.DoApiPost(c.GetChannelRoute(channelId)+"/restore", ""); err != nil {
return nil, &Response{StatusCode: r.StatusCode, Error: err}
} else {
defer closeBody(r)
return ChannelFromJson(r.Body), BuildResponse(r)
}
}
// CreateDirectChannel creates a direct message channel based on the two user
// ids provided.
func (c *Client4) CreateDirectChannel(userId1, userId2 string) (*Channel, *Response) {