whapi_as_array: Ensure "messages" or "updates" input is always a list of objects
Description
Utility to normalize webhook payloads so downstream parsers can safely map_dfr().
Accepts single objects, arrays of objects, or NULL, and always returns a list.
Usage
whapi_as_array(x, kind = c("message", "update"))
Value
A list of message/update objects (possibly length 0).
Arguments
x
Input object: NULL, a list (single message/update), or a list of lists.
kind
Either "message" or "update". Defines which keys to look for when
deciding if input is a single object.