(input *plugin.ApiResourceInput)
| 43 | } |
| 44 | |
| 45 | func PatchConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { |
| 46 | connection := &models.GhCopilotConnection{} |
| 47 | if err := connectionHelper.First(connection, input.Params); err != nil { |
| 48 | return nil, err |
| 49 | } |
| 50 | if err := (&models.GhCopilotConnection{}).MergeFromRequest(connection, input.Body); err != nil { |
| 51 | return nil, errors.Convert(err) |
| 52 | } |
| 53 | connection.Normalize() |
| 54 | if err := validateConnection(connection); err != nil { |
| 55 | return nil, err |
| 56 | } |
| 57 | if err := connectionHelper.SaveWithCreateOrUpdate(connection); err != nil { |
| 58 | return nil, err |
| 59 | } |
| 60 | return &plugin.ApiResourceOutput{Body: connection.Sanitize()}, nil |
| 61 | } |
| 62 | |
| 63 | func DeleteConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { |
| 64 | conn := &models.GhCopilotConnection{} |
nothing calls this directly
no test coverage detected