TestConnection tests the Taiga connection @Summary test taiga connection @Description Test Taiga Connection @Tags plugins/taiga @Param body body models.TaigaConnection true "json body" @Success 200 {object} TaigaTestConnResponse "Success" @Failure 400 {string} errcode.Error "Bad Request" @Failure
(input *plugin.ApiResourceInput)
| 129 | // @Failure 500 {string} errcode.Error "Internal Error" |
| 130 | // @Router /plugins/taiga/test [POST] |
| 131 | func TestConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { |
| 132 | // decode |
| 133 | var connection models.TaigaConnection |
| 134 | err := api.DecodeMapStruct(input.Body, &connection, false) |
| 135 | if err != nil { |
| 136 | return nil, err |
| 137 | } |
| 138 | // test connection |
| 139 | result, err := testConnection(context.TODO(), connection) |
| 140 | if err != nil { |
| 141 | return nil, plugin.WrapTestConnectionErrResp(basicRes, err) |
| 142 | } |
| 143 | return &plugin.ApiResourceOutput{Body: result, Status: http.StatusOK}, nil |
| 144 | } |
| 145 | |
| 146 | // TestExistingConnection tests an existing Taiga connection |
| 147 | // @Summary test existing taiga connection |
nothing calls this directly
no test coverage detected