toJson

fun List<Action>.toJson(): List<Any>

Ref: https://matrix.org/docs/spec/client_server/latest#actions.

Convert

"actions": [
    "notify",
    {
        "set_tweak": "sound",
        "value": "default"
    },
    {
        "set_tweak": "highlight"
    }
]

To
[
    Action.Notify,
    Action.Sound("default"),
    Action.Highlight(true)
]