Deserialize JSON messages into classes with hierarchy