I'm also looking for some type hierarchy about git...
# codereview
e
I'm also looking for some type hierarchy about github workflow triggers. Some may have sub-types, some may not. • checksuite, types: ◦ completed ◦ requested ◦ reRequested • delete I'd like to provide DSL methods where I can either request a trigger with
on(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:
Copy code
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?