generate type for enums