toMapWithOnlyPrimaryConstructorProperties

Can be used to convert an object of a data class to a map. https://www.baeldung.com/kotlin/data-class-to-map