elect
09/25/2021, 4:55 PMon(checksuite)
which includes all its sub-types, if any, or specify directly the sub-types with on(checksuite { completed, reRequested })
I'm puzzled which is the best design, but I'm guessing something with generics:
interface WebhookEventType<WebhookEventInterface>
interface WebhookEventInterface<T> {
operator fun invoke(vararg a: WebhookEventType<T>)
}
interface WebhookEvent {
object checkRun : WebhookEventInterface<checkRun> {
object create : WebhookEventType<checkRun>
object reRequested: WebhookEventType<checkRun>
object completed: WebhookEventType<checkRun>
override fun invoke(vararg a: WebhookEventType<WebhookEventInterface<checkRun>>) { .. }
}
}
any better idea?