diff options
author | Carlos Tadeu Panato Junior <ctadeu@gmail.com> | 2017-03-23 12:02:42 +0100 |
---|---|---|
committer | George Goldberg <george@gberg.me> | 2017-03-23 11:02:42 +0000 |
commit | 78e5b803cc0817e1b5d58ca27a7ad8ad22616602 (patch) | |
tree | 4c0eeb601dc590901801936c3727b14c0bfb547e /model | |
parent | 0326177253bd3b4a2933e084a8759473998b60c0 (diff) | |
download | chat-78e5b803cc0817e1b5d58ca27a7ad8ad22616602.tar.gz chat-78e5b803cc0817e1b5d58ca27a7ad8ad22616602.tar.bz2 chat-78e5b803cc0817e1b5d58ca27a7ad8ad22616602.zip |
add implementation to get outgoing webhook for apiv4 (#5827)
Diffstat (limited to 'model')
-rw-r--r-- | model/client4.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/model/client4.go b/model/client4.go index 420b8d510..5b7f502e1 100644 --- a/model/client4.go +++ b/model/client4.go @@ -1341,6 +1341,16 @@ func (c *Client4) GetOutgoingWebhooks(page int, perPage int, etag string) ([]*Ou } } +// GetOutgoingWebhook outgoing webhooks on the system requested by Hook Id. +func (c *Client4) GetOutgoingWebhook(hookId string) (*OutgoingWebhook, *Response) { + if r, err := c.DoApiGet(c.GetOutgoingWebhookRoute(hookId), ""); err != nil { + return nil, &Response{StatusCode: r.StatusCode, Error: err} + } else { + defer closeBody(r) + return OutgoingWebhookFromJson(r.Body), BuildResponse(r) + } +} + // GetOutgoingWebhooksForChannel returns a page of outgoing webhooks for a channel. Page counting starts at 0. func (c *Client4) GetOutgoingWebhooksForChannel(channelId string, page int, perPage int, etag string) ([]*OutgoingWebhook, *Response) { query := fmt.Sprintf("?page=%v&per_page=%v&channel_id=%v", page, perPage, channelId) |