TestConnection test slack connection @Summary test slack connection @Description Test slack Connection. endpoint: https://open.slack.cn/open-apis/ @Tags plugins/slack @Param body body models.SlackConn true "json body" @Success 200 {object} SlackTestConnResponse "Success" @Failure 400 {string} errc
(input *plugin.ApiResourceInput)
| 64 | // @Failure 500 {string} errcode.Error "Internal Error" |
| 65 | // @Router /plugins/slack/test [POST] |
| 66 | func TestConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { |
| 67 | // process input |
| 68 | var connection models.SlackConn |
| 69 | if err := api.Decode(input.Body, &connection, vld); err != nil { |
| 70 | return nil, errors.BadInput.Wrap(err, "could not decode request parameters") |
| 71 | } |
| 72 | // test connection |
| 73 | result, err := testConnection(context.TODO(), connection) |
| 74 | if err != nil { |
| 75 | return nil, plugin.WrapTestConnectionErrResp(basicRes, err) |
| 76 | } |
| 77 | return &plugin.ApiResourceOutput{Body: result, Status: http.StatusOK}, nil |
| 78 | } |
| 79 | |
| 80 | // TestExistingConnection test slack connection |
| 81 | // @Summary test slack connection |
nothing calls this directly
no test coverage detected