private static Shape validateShape(Shape shape) {
        if (shape.isEnumShape() || (shape.isStringShape() && shape.hasTrait(EnumTrait.class))) {
            return shape;
        }
        throw new IllegalArgumentException("GenerateEnum requires an enum shape or a string shape with the enum trait");
    }
Directive used to generate an enum shape or enum string shape.

@param <C> CodegenContext type.
@param <S> Codegen settings type.
@see DirectedCodegen#generateEnumShape
smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/directed/GenerateEnumDirective.java