deserialize enum from object representation