I have the following question. The following code snippet throws me the error shown below. allowedWebhookStates
contains enums. What do I have to change so that I can check whether the setOf
of allowedWebhookStates
contains the web.event
which is a string?
private val allowedWebhookStates = setOf(
REQUEST,
DELIVERED ,
UNIQUE_OPENED,
OPENED,
CLICK,
SOFT_BOUNCE,
HARD_BOUNCE,
INVALID_EMAIL,
DEFERRED,
SPAM,
UNSUBSCRIBED,
BLOCKED,
PROXY_OPEN,
ERROR
)
if (web.event in allowedWebhookStates) {
...
}
Error:
Type inference failed. The value of the type parameter T should be mentioned in input types (argument types, receiver type or expected type). Try to specify it explicitly