From 0a20e8d3269515e2d44a0bcad0a2408f62245814 Mon Sep 17 00:00:00 2001 From: Robin Naundorf Date: Mon, 15 May 2017 22:12:30 +0200 Subject: PLT-6019: Add APIv4 Endpoint for restoring Channels (#6263) --- model/client4.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'model') diff --git a/model/client4.go b/model/client4.go index 4a01a1f75..f4a247e12 100644 --- a/model/client4.go +++ b/model/client4.go @@ -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) { -- cgit v1.2.3-1-g7c22