(ctx context.Context, id string)
| 10 | ) |
| 11 | |
| 12 | func Delete(ctx context.Context, id string) error { |
| 13 | c, err := config.ScalingoAuthClient(ctx) |
| 14 | if err != nil { |
| 15 | return errors.Wrapf(ctx, err, "fail to get Scalingo client") |
| 16 | } |
| 17 | |
| 18 | integration, err := c.SCMIntegrationsShow(ctx, id) |
| 19 | if err != nil { |
| 20 | return errors.Wrapf(ctx, err, "not linked SCM integration or unknown SCM integration") |
| 21 | } |
| 22 | |
| 23 | err = c.SCMIntegrationsDelete(ctx, id) |
| 24 | if err != nil { |
| 25 | return errors.Wrapf(ctx, err, "fail to destroy SCM integration") |
| 26 | } |
| 27 | |
| 28 | io.Statusf("Your Scalingo account and your %s account are unlinked.\n", scalingo.SCMTypeDisplay[integration.SCMType]) |
| 29 | return nil |
| 30 | } |
no test coverage detected