public EnumShape expectEnumShape() {
        return shape().asEnumShape()
                .orElseThrow(() -> new ExpectationNotMetException(
                        "Expected an enum shape, but found " + shape(),
                        shape()));
    }
Gets the {@link EnumTrait} of the shape.

@return Returns the enum trait.
smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/directed/GenerateEnumDirective.java