toJson

fun toJson(id: String? = null, version: Int = PROTOCOL_VERSION): JsonObject

The wire shape with the protocol version and an optional request id.