PostConnections creates a new Copilot connection.
(input *plugin.ApiResourceInput)
| 26 | |
| 27 | // PostConnections creates a new Copilot connection. |
| 28 | func PostConnections(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { |
| 29 | connection := &models.GhCopilotConnection{} |
| 30 | if err := helper.Decode(input.Body, connection, vld); err != nil { |
| 31 | return nil, err |
| 32 | } |
| 33 | |
| 34 | connection.Normalize() |
| 35 | if err := validateConnection(connection); err != nil { |
| 36 | return nil, err |
| 37 | } |
| 38 | |
| 39 | if err := connectionHelper.Create(connection, input); err != nil { |
| 40 | return nil, err |
| 41 | } |
| 42 | return &plugin.ApiResourceOutput{Body: connection.Sanitize()}, nil |
| 43 | } |
| 44 | |
| 45 | func PatchConnection(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput, errors.Error) { |
| 46 | connection := &models.GhCopilotConnection{} |
nothing calls this directly
no test coverage detected