@Summary patch ae connection @Description Patch AE connection @Tags plugins/ae @Param body body models.AeConnection true "json body" @Success 200 {object} models.AeConnection "Success" @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internal Error" @Router /p
(input *plugin.ApiResourceInput)
| 164 | // @Failure 500 {string} errcode.Error "Internal Error" |
| 165 | // @Router /plugins/ae/connections/{connectionId} [PATCH] |
| 166 | func PatchConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { |
| 167 | connection := &models.AeConnection{} |
| 168 | if err := connectionHelper.First(&connection, input.Params); err != nil { |
| 169 | return nil, err |
| 170 | } |
| 171 | if err := (&models.AeConnection{}).MergeFromRequest(connection, input.Body); err != nil { |
| 172 | return nil, errors.Convert(err) |
| 173 | } |
| 174 | if err := connectionHelper.SaveWithCreateOrUpdate(connection); err != nil { |
| 175 | return nil, err |
| 176 | } |
| 177 | return &plugin.ApiResourceOutput{Body: connection.Sanitize(), Status: http.StatusOK}, nil |
| 178 | } |
| 179 | |
| 180 | // @Summary delete a ae connection |
| 181 | // @Description Delete a AE connection |
nothing calls this directly
no test coverage detected