Generate nested enum classes and moved nested classes outside of the parent class.