Add toProtobufEvent method on Event class.