From 5efcd2d9d3fb91ae7475918b807b7947b533da9b Mon Sep 17 00:00:00 2001 From: Robin Naundorf Date: Tue, 9 May 2017 14:52:46 +0200 Subject: Add API Endpoint for deleted Channels (#5889) --- model/client4.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'model') diff --git a/model/client4.go b/model/client4.go index 3a6507f82..7e0cd1acf 100644 --- a/model/client4.go +++ b/model/client4.go @@ -1242,6 +1242,17 @@ func (c *Client4) GetPublicChannelsForTeam(teamId string, page int, perPage int, } } +// GetDeletedChannelsForTeam returns a list of public channels based on the provided team id string. +func (c *Client4) GetDeletedChannelsForTeam(teamId string, page int, perPage int, etag string) (*ChannelList, *Response) { + query := fmt.Sprintf("/deleted?page=%v&per_page=%v", page, perPage) + if r, err := c.DoApiGet(c.GetChannelsForTeamRoute(teamId)+query, etag); err != nil { + return nil, &Response{StatusCode: r.StatusCode, Error: err} + } else { + defer closeBody(r) + return ChannelListFromJson(r.Body), BuildResponse(r) + } +} + // GetPublicChannelsByIdsForTeam returns a list of public channels based on provided team id string func (c *Client4) GetPublicChannelsByIdsForTeam(teamId string, channelIds []string) (*ChannelList, *Response) { if r, err := c.DoApiPost(c.GetChannelsForTeamRoute(teamId)+"/ids", ArrayToJson(channelIds)); err != nil { -- cgit v1.2.3-1-g7c22