(ctx context.Context, rep repo.Repository)
| 31 | } |
| 32 | |
| 33 | func (c *commandNotificationProfileShow) run(ctx context.Context, rep repo.Repository) error { |
| 34 | pc, err := notifyprofile.GetProfile(ctx, rep, c.profileName) |
| 35 | if err != nil { |
| 36 | return errors.Wrap(err, "unable to list notification profiles") |
| 37 | } |
| 38 | |
| 39 | summ := getProfileSummary(ctx, pc) |
| 40 | |
| 41 | if !c.jo.jsonOutput { |
| 42 | c.out.printStdout("Profile %q Type %q Minimum Severity: %v\n%v\n", |
| 43 | summ.ProfileName, |
| 44 | pc.MethodConfig.Type, |
| 45 | notification.SeverityToString[pc.MinSeverity], |
| 46 | summ.Summary) |
| 47 | |
| 48 | return nil |
| 49 | } |
| 50 | |
| 51 | if c.raw { |
| 52 | c.out.printStdout("%s\n", c.jo.jsonBytes(pc)) |
| 53 | } else { |
| 54 | c.out.printStdout("%s\n", c.jo.jsonBytes(summ)) |
| 55 | } |
| 56 | |
| 57 | return nil |
| 58 | } |
nothing calls this directly
no test coverage detected