Right now, hooks are created with parameters specified by HookInput, which contains a HookEvents to indicate which abstract event should be listened to. But the Hook struct returned by FindHook() contains Events []string, which is a list of native event names. This makes it hard to implement a "reconciliation" logic, where the program needs to check if an existing webhook matches a HookInput to decide if it should recreate the webhook. The workaround is to only use HookInput.NativeEvents and don't rely on HookInput.Events at all.
It seems reasonable to change Hook.Events from []string to HookEvents, and introduce a HookEvents.NativeEvents field to make the API more consistent. However, these are all breaking changes.
Would it make sense to deprecate HookInput.Events, HookInput.NativeEvents and Hook.Events, and instead having a new field name for HookEvents in both HookInput and Hook?
Right now, hooks are created with parameters specified by
HookInput, which contains aHookEventsto indicate which abstract event should be listened to. But theHookstruct returned byFindHook()containsEvents []string, which is a list of native event names. This makes it hard to implement a "reconciliation" logic, where the program needs to check if an existing webhook matches aHookInputto decide if it should recreate the webhook. The workaround is to only useHookInput.NativeEventsand don't rely onHookInput.Eventsat all.It seems reasonable to change
Hook.Eventsfrom[]stringtoHookEvents, and introduce aHookEvents.NativeEventsfield to make the API more consistent. However, these are all breaking changes.Would it make sense to deprecate
HookInput.Events,HookInput.NativeEventsandHook.Events, and instead having a new field name forHookEventsin bothHookInputandHook?