| 69 | } |
| 70 | |
| 71 | func getProfileSummary(ctx context.Context, pc notifyprofile.Config) notifyprofile.Summary { |
| 72 | var summ notifyprofile.Summary |
| 73 | |
| 74 | summ.ProfileName = pc.ProfileName |
| 75 | summ.Type = string(pc.MethodConfig.Type) |
| 76 | summ.MinSeverity = int32(pc.MinSeverity) |
| 77 | |
| 78 | // Provider returns a new instance of the notification provider. |
| 79 | if prov, err := sender.GetSender(ctx, pc.ProfileName, pc.MethodConfig.Type, pc.MethodConfig.Config); err == nil { |
| 80 | summ.Summary = prov.Summary() |
| 81 | } else { |
| 82 | summ.Summary = fmt.Sprintf("%v - invalid", pc.MethodConfig.Type) |
| 83 | } |
| 84 | |
| 85 | return summ |
| 86 | } |