NormalizeEventTypes drops blank and duplicate event types, which the API rejects.
(names []string)
| 22 | |
| 23 | // NormalizeEventTypes drops blank and duplicate event types, which the API rejects. |
| 24 | func NormalizeEventTypes(names []string) []string { |
| 25 | var types []string |
| 26 | for _, name := range names { |
| 27 | name = strings.TrimSpace(name) |
| 28 | if name == "" || slices.Contains(types, name) { |
| 29 | continue |
| 30 | } |
| 31 | types = append(types, name) |
| 32 | } |
| 33 | return types |
| 34 | } |
| 35 | |
| 36 | // SubscriptionNotFoundError reports a subscription the API did not find. The API does not tell a missing |
| 37 | // subscription apart from an expired, deleted, or another account's one. |