ListConnections @Summary get all webhook connections @Description Get all webhook connections @Tags plugins/webhook @Success 200 {object} []WebhookConnectionResponse @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /plugins/webhook/con
(input *plugin.ApiResourceInput)
| 200 | // @Failure 500 {string} errcode.Error "Internal Error" |
| 201 | // @Router /plugins/webhook/connections [GET] |
| 202 | func ListConnections(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { |
| 203 | var connections []models.WebhookConnection |
| 204 | err := connectionHelper.List(&connections) |
| 205 | if err != nil { |
| 206 | return nil, err |
| 207 | } |
| 208 | responseList := []*WebhookConnectionResponse{} |
| 209 | for _, connection := range connections { |
| 210 | webhookConnectionResponse, err := formatConnection(&connection, true) |
| 211 | if err != nil { |
| 212 | return nil, err |
| 213 | } |
| 214 | responseList = append(responseList, webhookConnectionResponse) |
| 215 | } |
| 216 | return &plugin.ApiResourceOutput{Body: responseList, Status: http.StatusOK}, nil |
| 217 | } |
| 218 | |
| 219 | // GetConnection |
| 220 | // @Summary get webhook connection detail |
nothing calls this directly
no test coverage detected