Serialise to the wire format.
Map<String, Object?> toJson() => <String, Object?>{ 'kind': kind, 'router': router, 'detail': detail, };